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 entries with natural sorting #328

Merged
merged 2 commits into from
Mar 13, 2024

Conversation

lucaseras
Copy link
Contributor

@lucaseras lucaseras commented Mar 10, 2024

Does #306. Some screenshots of Oil after this change:

With default sorting

image

Before, the file 15 would come before 9. Likewise, v114.lua would come before v24.lua

With descending name

image

Happy to make this an optional feature!

@github-actions github-actions bot requested a review from stevearc March 10, 2024 04:40
@stevearc
Copy link
Owner

Thanks for the PR! I pulled this locally to profile it and kick the tires. There was a bug in the implementation: if you sort by other columns (e.g. size) the values can be numbers. I moved the natural ordering into the definition of the name column, and then also put it behind a config option because I profiled it as being about an order of magnitude slower. For most situations this is probably fine, but if you work with large directories it could cause pauses, so I want to make sure there's a way to disable it.

LMK if this approach works for you

@lucaseras
Copy link
Contributor Author

Sweet, looks good! Appreciate the help 🙏🏻

@stevearc stevearc merged commit 71b076b into stevearc:master Mar 13, 2024
8 checks passed
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

Successfully merging this pull request may close these issues.

2 participants