diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-08-17 16:39:08 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-17 16:39:08 +0800 |
commit | fb78c1983c267f622c1983a999f5fb8bdfc85c73 (patch) | |
tree | 40326a4d586d1acbc4251fcbf35f9a8efc596318 /src/nvim/eval.lua | |
parent | 200dafb8a5839826bc157bdc9153f1171ce639e1 (diff) | |
parent | 6267996f13c5fd2ae8023b85c48e0e207e278cd9 (diff) | |
download | rneovim-fb78c1983c267f622c1983a999f5fb8bdfc85c73.tar.gz rneovim-fb78c1983c267f622c1983a999f5fb8bdfc85c73.tar.bz2 rneovim-fb78c1983c267f622c1983a999f5fb8bdfc85c73.zip |
Merge pull request #24750 from zeertzjq/vim-8.2.4450
vim-patch:8.2.{4450,4451,4455}
Diffstat (limited to 'src/nvim/eval.lua')
-rw-r--r-- | src/nvim/eval.lua | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/src/nvim/eval.lua b/src/nvim/eval.lua index f8ba16365a..1ce6b0b247 100644 --- a/src/nvim/eval.lua +++ b/src/nvim/eval.lua @@ -10157,15 +10157,16 @@ M.funcs = { If you want a list to remain unmodified make a copy first: >vim let sortedlist = sort(copy(mylist)) - <When {func} is omitted, is empty or zero, then sort() uses the + <When {how} is omitted or is a string, then sort() uses the string representation of each item to sort on. Numbers sort after Strings, |Lists| after Numbers. For sorting text in the current buffer use |:sort|. - When {func} is given and it is '1' or 'i' then case is - ignored. + When {how} is given and it is 'i' then case is ignored. + For backwards compatibility, the value one can be used to + ignore case. Zero means to not ignore case. - When {func} is given and it is 'l' then the current collation + When {how} is given and it is 'l' then the current collation locale is used for ordering. Implementation details: strcoll() is used to compare strings. See |:language| check or set the collation locale. |v:collate| can also be used to check the @@ -10182,19 +10183,19 @@ M.funcs = { < ['n', 'o', 'O', 'p', 'z', 'รถ'] ~ This does not work properly on Mac. - When {func} is given and it is 'n' then all items will be + When {how} is given and it is 'n' then all items will be sorted numerical (Implementation detail: this uses the strtod() function to parse numbers, Strings, Lists, Dicts and Funcrefs will be considered as being 0). - When {func} is given and it is 'N' then all items will be + When {how} is given and it is 'N' then all items will be sorted numerical. This is like 'n' but a string containing digits will be used as the number they represent. - When {func} is given and it is 'f' then all items will be + When {how} is given and it is 'f' then all items will be sorted numerical. All values must be a Number or a Float. - When {func} is a |Funcref| or a function name, this function + When {how} is a |Funcref| or a function name, this function is called to compare items. The function is invoked with two items as argument and must return zero if they are equal, 1 or bigger if the first one sorts after the second one, -1 or @@ -10224,8 +10225,8 @@ M.funcs = { < ]=], name = 'sort', - params = { { 'list', 'any' }, { 'func', 'any' }, { 'dict', 'any' } }, - signature = 'sort({list} [, {func} [, {dict}]])', + params = { { 'list', 'any' }, { 'how', 'any' }, { 'dict', 'any' } }, + signature = 'sort({list} [, {how} [, {dict}]])', }, soundfold = { args = 1, |