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

Not alphanumeric, but natural sort order? #27

Closed
holroy opened this issue Nov 9, 2022 · 2 comments · Fixed by #28
Closed

Not alphanumeric, but natural sort order? #27

holroy opened this issue Nov 9, 2022 · 2 comments · Fixed by #28
Assignees
Labels
enhancement New feature or request

Comments

@holroy
Copy link

holroy commented Nov 9, 2022

In your documentation you state that this plugin uses alphanumeric, but it seems to use natural sort order. That is that x7, x8 and x70, is sorted according to the number sequence of 7, 8, 70, and not the alphanumeric sequence of 7, 70, 8.

Is this a bug or a feature? And either way, would it be possible to get it to do true alphanumeric sorting?

In the image below I show the result after applying the sorting specification within my file CustomSort, and how it then doesn't show the files in alphanumeric order. Also included are the sequence of the hexadecimal numbers, 0x01FF, 0x0200 and 0x02FF, which are out of order due to the same issue. The 0x02FF is in the middle instead of at the end. Finally the image shows that the custom sort is effective (which also can be seen by file in reverse sort order outside of the SortingBug folder.

image

Regards,
Holroy

@SebastianMC SebastianMC self-assigned this Nov 9, 2022
@SebastianMC SebastianMC added the enhancement New feature or request label Nov 9, 2022
SebastianMC added a commit that referenced this issue Nov 9, 2022
- added new token 'true a-z'
- unit tests coverage of the extended logic
- added example in README.md
@SebastianMC SebastianMC linked a pull request Nov 9, 2022 that will close this issue
SebastianMC added a commit that referenced this issue Nov 9, 2022
…order

#27 - support for true alphabetical order
@SebastianMC
Copy link
Owner

Hi @holroy,

you suggested, you received ;-)

In the recent release 1.1.0 I've added the syntax < true a-z and > true a-z to intentionally trigger the true alphabetical order.

More info about the meaning of 'a-z' in this new section of README.md

If you adjust your test sorting spec to:

sorting-spec: |
 target-folder: MaDo/...
 > true a-z
 target-folder: MaDo/Sandbox/SortingBug
 < true a-z

you can enjoy the true alphabetical sorting order which you asked for

regards,
Seb

@holroy
Copy link
Author

holroy commented Nov 10, 2022

Thanks for the swift response. I've now added the following sorting specifications

sorting-spec: |
  target-folder: /*
  < true a-z

And my files (in whatever folder) comes in true alphanumeric sorting. Thanks again!

Regards,
Holroy

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

Successfully merging a pull request may close this issue.

2 participants