codecadwallader / codemaid

CodeMaid is an open source Visual Studio extension to cleanup and simplify our C#, C++, F#, VB, PHP, PowerShell, JSON, XAML, XML, ASP, HTML, CSS, LESS, SCSS, JavaScript and TypeScript coding.
http://www.codemaid.net
GNU Lesser General Public License v3.0
1.88k stars 352 forks source link

Sort Lines ignores leading tick ' #1034

Open codefrog2002 opened 5 months ago

codefrog2002 commented 5 months ago

Environment

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 commented 5 months ago

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 commented 5 months ago

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.