Sunday, November 1, 2020

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

On 2020-11-01, Dominique Pellé wrote:
> Dominique Pellé wrote:
>
> > Tekki 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

Is this consistent with Christian's fix for #6229 in June?
I haven't looked at either patch closely--I just remembered that
this issue had been discussed before--but they seem to take
different approaches to setting the collation order. I don't
particularly care how it's done, but I do care that it's done
consistently.

Regards,
Gary

--
--
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/20201102013130.GA10555%40phoenix.

No comments: