Sunday, November 1, 2020

Re: the :sort command does not appear to give expected result

Dominique Pellé <dominique.pelle@gmail.com> wrote:

> Tekki <tekki@tekki.ch> wrote:
>
> > Chris Jones schrieb am Samstag, 31. Oktober 2020 um 20:16:53 UTC+1:
> >>
> >>
> >> So what's the next step?
> >>
> >
> > You could create your own sort command in vimrc, for example
> >
> > command -nargs=1 Sort :.,+<args>!sort -
> >
> > Then :Sort7 will sort the above list of letters correctly.
>
> Indeed, you could use %!sort to use the Unix sort command
> instead of the Vim ex command (possibly replace % with
> another range if you don't want to sort the entire file).
>
> That said, sorting using the locale ordering with Ex :sort
> could be useful. I see that ex_sort() in ex_cmds.c calls
> sort_compare() and that function calls STRCMP() or
> STRICMP(). strcmp() not use the locale, but strcoll() does.
> We could consider adding a sorting option to honor the current
> locale (e.g. :sort l) which would compare using strcoll() instead
> of STRCMP or STRICMP.

I just created a git pull request to implement sorting using the
current locale. It adds a l option to the :sort Ex command.

See:

https://github.com/vim/vim/pull/7237

Regards
Dominique

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/CAON-T_iB%2BW_-4uOPGCu31gzRVtxaCwFQopmRDQQyu0PCKfkR-w%40mail.gmail.com.

No comments: