Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sort Lines ignores leading tick ' #1034

Open
codefrog2002 opened this issue Jan 19, 2024 · 2 comments
Open

Sort Lines ignores leading tick ' #1034

codefrog2002 opened this issue Jan 19, 2024 · 2 comments

Comments

@codefrog2002
Copy link

Environment

  • Visual Studio version: [VS 2022 Community Preview]
  • CodeMaid version: [12.0]
  • Code language: [txt]

Description

Sort lines [ctrl-m F9] is ignoring a leading tick ' when sorting.

Steps to recreate

a
b
c
'a
'b
'c

Select the 6 lines and sort-by-line (ctrl-m F9)

Current behavior

a
'a
b
'b
c
'c

Sort lines ignored the leading ticks.

Expected behavior

'a
'b
'c
a
b
c

Sorted by ascii value [ ascii ' precedes ascii a,b,c]

@codefrog2002
Copy link
Author

Note that other punctuation sorts as expected by ascii value

a
b
c
'a
'b
'c
`a
`b
`c
"a
"b
"c

sorts to

"a
"b
"c
`a
`b
`c
a
'a
b
'b
c
'c

@codefrog2002
Copy link
Author

For my current purposes (which are limited to English) I was able to patch the relevant line in SortLinesCommand.SortText

            var orderedText = splitText.OrderBy(x => x,  StringComparer.Ordinal);

But I fear this would break the sorts for people using other alphabets and codepoints.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant