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

Line Operations: Add support for locale-aware sorting #819

Closed
danpla opened this issue Feb 8, 2019 · 4 comments
Closed

Line Operations: Add support for locale-aware sorting #819

danpla opened this issue Feb 8, 2019 · 4 comments

Comments

@danpla
Copy link

danpla commented Feb 8, 2019

Line operations currently use strcmp(), so sorting non-ASCII text gives nonsense (because it sorts by bites of UTF-8 sequences). It would be nice to have normal sorting that use g_utf8_collate() (or g_utf8_collate_key() for better performance) either by default (replacing strcmp()) or as separate operations.

@smostertdev
Copy link
Contributor

I'll see if I can get lineoperations working with non-ASCII characters. Thanks for pointing this out.

@elextr
Copy link
Member

elextr commented Jul 28, 2019

Probably best to make it separate operations, strcmp() isn't nonsense, it sorts by Unicode code point value, which is useful in some cases, and adding sorting by some locale stuff is useful in others.

Also there is the problem of what locale it uses. Remember files are shared around the world by github and friends, and having things sort by whatever locale the particular person editing it lives in isn't usually very sensible.

And requiring a user to restart Geany in a different locale to get the sort that a particular file requires is not a very user friendly approach either.

@lpaulsen93
Copy link
Contributor

@danpla: this enhancement has been implemented by @smostertdev now and will be included in the next release of geany-plugins.

@danpla
Copy link
Author

danpla commented Sep 8, 2019

Thanks!

@danpla danpla closed this as completed Sep 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants