On 2020-06-10, K.Takata wrote:
>     A generic, but possibly complicated solution, is to add an argument to
>     specify the sorting:
>     none - byte order
>     icase - current case-folding comparison
>     collate - using language from environment
>     collate:{lang} - collattion using specific language
> 
> How about:
> 
> none - unsorted
> case - byte order (default)
> icase - current case-folding comparison

As I understand it, Vim's current case-folding comparison does
a stationary sort.  So, if locale shows LC_COLLATE="en_US.UTF-8",
and the OS happened to put README, Readme and readme in the
directory in this order, for example,

    Readme
    readme
    README

Vim's "sort i" would leave them in that order, but Vim's glob("*")
would sort them as

    README
    Readme
    readme

and both ":!sort" and ":!echo *" would sort them as

    readme
    Readme
    README

I still don't think that a purely case-insensitive sort is what
should be used for readdirex() or readdir() because the results will
be in an order dependent upon the order in which the OS happened to
put them in the directory.  Two directories containing the same
files could case-insensitively sort differently.

Making a case-insensitive file name comparison can be useful, but
for sorting a directory, we should pick a set of collations or
unsorted.  Call one dictionary order or case-folded, but not
case-insensitive.

Regards,
Gary

-- 
-- 
You received this message from the "vim_dev" 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_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/20200610164315.GH3695%40phoenix.

Raspunde prin e-mail lui