1
0
forked from aniani/vim

patch 9.0.1396: sort(list, 'N') does not work in Vim9 script context

Problem:    sort(list, 'N') does not work in Vim9 script context.
Solution:   Convert string to number without giving an error. (closes #12061)
This commit is contained in:
Bram Moolenaar
2023-03-09 22:06:49 +00:00
parent 638388b8ef
commit be19d78c3d
6 changed files with 31 additions and 10 deletions

View File

@@ -8641,8 +8641,9 @@ sort({list} [, {how} [, {dict}]]) *sort()* *E702*
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).
strtod() function to parse numbers. Strings, Lists, Dicts and
Funcrefs will be considered as being 0). Note that this won't
sort a list of strings with numbers!
When {how} is given and it is 'N' then all items will be
sorted numerical. This is like 'n' but a string containing