aboutsummaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
authorwatiko <service@mail.watiko.net>2016-02-20 17:18:23 +0900
committerwatiko <service@mail.watiko.net>2016-03-02 17:32:24 +0900
commitf6dca79f3aa2b55927a5f1cee4a6bf25d5c9bd37 (patch)
tree52c95d1a5b11bdd16b73e13a22a9d179cccac34a /runtime
parent576c5f7b74bfa46ba4c7290b5e5b951d3ee2d0bc (diff)
downloadrneovim-f6dca79f3aa2b55927a5f1cee4a6bf25d5c9bd37.tar.gz
rneovim-f6dca79f3aa2b55927a5f1cee4a6bf25d5c9bd37.tar.bz2
rneovim-f6dca79f3aa2b55927a5f1cee4a6bf25d5c9bd37.zip
vim-patch:7.4.951
Problem: Sorting number strings does not work as expected. (Luc Hermitte) Solution: Add the 'N" argument to sort() https://github.com/vim/vim/commit/b00da1d6d1655cb6e415f84ecc3be5ff3b790811
Diffstat (limited to 'runtime')
-rw-r--r--runtime/doc/eval.txt9
1 files changed, 9 insertions, 0 deletions
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index 0b2880ef03..36613ba6b3 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -6043,6 +6043,10 @@ sort({list} [, {func} [, {dict}]]) *sort()* *E702*
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
+ sorted numerical. This is like 'n' but a string containing
+ digits will be used as the number they represent.
+
When {func} 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
@@ -6057,6 +6061,11 @@ sort({list} [, {func} [, {dict}]]) *sort()* *E702*
on numbers, text strings will sort next to each other, in the
same order as they were originally.
+ The sort is stable, items which compare equal (as number or as
+ string) will keep their relative position. E.g., when sorting
+ on numbers, text strings will sort next to each other, in the
+ same order as they were originally.
+
Also see |uniq()|.
Example: >