aboutsummaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2016-04-25 03:56:33 -0400
committerJustin M. Keyes <justinkz@gmail.com>2016-04-25 03:56:33 -0400
commit588bc1d9586bc65b63519bc9d292fa4ab59b2dba (patch)
treee1cb76952f7dc0008ba9f2fc11d13da80d9a94e2 /runtime
parent121e76db6f2dd2a088ba0fabd17fd80425347d50 (diff)
parent1addc45e78155a73f52a00762cb77abbd3f8d993 (diff)
downloadrneovim-588bc1d9586bc65b63519bc9d292fa4ab59b2dba.tar.gz
rneovim-588bc1d9586bc65b63519bc9d292fa4ab59b2dba.tar.bz2
rneovim-588bc1d9586bc65b63519bc9d292fa4ab59b2dba.zip
Merge #4303 'vim-patch:7.4.{951,1143,1144}'.
Diffstat (limited to 'runtime')
-rw-r--r--runtime/doc/change.txt18
-rw-r--r--runtime/doc/eval.txt9
2 files changed, 22 insertions, 5 deletions
diff --git a/runtime/doc/change.txt b/runtime/doc/change.txt
index cfe8a87746..56b45497dc 100644
--- a/runtime/doc/change.txt
+++ b/runtime/doc/change.txt
@@ -1646,7 +1646,7 @@ Vim has a sorting function and a sorting command. The sorting function can be
found here: |sort()|, |uniq()|.
*:sor* *:sort*
-:[range]sor[t][!] [i][u][r][n][x][o][b] [/{pattern}/]
+:[range]sor[t][!] [b][f][i][n][o][r][u][x] [/{pattern}/]
Sort lines in [range]. When no range is given all
lines are sorted.
@@ -1654,10 +1654,18 @@ found here: |sort()|, |uniq()|.
With [i] case is ignored.
+ Options [n][f][x][o][b] are mutually exclusive.
+
With [n] sorting is done on the first decimal number
in the line (after or inside a {pattern} match).
One leading '-' is included in the number.
+ With [f] sorting is done on the Float in the line.
+ The value of Float is determined similar to passing
+ the text (after or inside a {pattern} match) to
+ str2float() function. This option is available only
+ if Vim was compiled with Floating point support.
+
With [x] sorting is done on the first hexadecimal
number in the line (after or inside a {pattern}
match). A leading "0x" or "0X" is ignored.
@@ -1669,10 +1677,10 @@ found here: |sort()|, |uniq()|.
With [b] sorting is done on the first binary number in
the line (after or inside a {pattern} match).
- With [u] only keep the first of a sequence of
- identical lines (ignoring case when [i] is used).
- Without this flag, a sequence of identical lines
- will be kept in their original order.
+ With [u] (u stands for unique) only keep the first of
+ a sequence of identical lines (ignoring case when [i]
+ is used). Without this flag, a sequence of identical
+ lines will be kept in their original order.
Note that leading and trailing white space may cause
lines to be different.
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index 148ac7732a..f6bdde2d39 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -6144,6 +6144,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
@@ -6158,6 +6162,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: >