Skip to content

Question/confusiong about sort algorithm #14

@farzadmf

Description

@farzadmf

Hi there, let's say I have the following lines:

01-one
2-two-no-zero
this
is
THIS
Text
text
00-zero

When I sort them (using sort.nvim), I get this:

THIS
Text
is
text
this
00-zero
01-one
2-two-no-zero

Which doesn't seem right 🤔 ... Why are numbered items after all the alphabet characters?

Running :sort on the lines, gives:

00-zero
01-one
2-two-no-zero
THIS
Text
is
text
this

And side: I understand that uppercase characters are all before lowercase characters, but I find Text before is confusing, and I was wondering if there's a way to actually treat uppercase and lowercase of the same character as "equal"

For example, using sort command (GNU sort 9.7) seems to do the most intuitive sort:

sort sort-test

00-zero
01-one
2-two-no-zero
is
text
Text
this
THIS

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions