summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvimboss <devnull@localhost>2007-07-10 15:26:20 +0000
committervimboss <devnull@localhost>2007-07-10 15:26:20 +0000
commit487ddaeaa076b658a3688855999b073ae107020e (patch)
tree421bc019bf798072ba8c39efe1f6dca816680f3c
parentce02ba7d6b709841ca37f7e4952f14d421fa11c1 (diff)
downloadvim-487ddaeaa076b658a3688855999b073ae107020e.tar.gz
updated for version 7.1-028v7.1.028v7-1-028
-rw-r--r--runtime/doc/change.txt4
-rw-r--r--src/ex_cmds.c6
-rw-r--r--src/version.c2
3 files changed, 11 insertions, 1 deletions
diff --git a/runtime/doc/change.txt b/runtime/doc/change.txt
index e82256df..c1eed2c0 100644
--- a/runtime/doc/change.txt
+++ b/runtime/doc/change.txt
@@ -1571,6 +1571,10 @@ found here: |sort()|.
in their original order, right before the sorted
lines.
+ If {pattern} is empty (e.g. // is specified), the
+ last search pattern is used. This allows trying out
+ a pattern first.
+
Note that using ":sort" with ":global" doesn't sort the matching lines, it's
quite useless.
diff --git a/src/ex_cmds.c b/src/ex_cmds.c
index 5ca3dfd0..66bbb188 100644
--- a/src/ex_cmds.c
+++ b/src/ex_cmds.c
@@ -408,7 +408,11 @@ ex_sort(eap)
goto sortend;
}
*s = NUL;
- regmatch.regprog = vim_regcomp(p + 1, RE_MAGIC);
+ /* Use last search pattern if sort pattern is empty. */
+ if (s == p + 1 && last_search_pat() != NULL)
+ regmatch.regprog = vim_regcomp(last_search_pat(), RE_MAGIC);
+ else
+ regmatch.regprog = vim_regcomp(p + 1, RE_MAGIC);
if (regmatch.regprog == NULL)
goto sortend;
p = s; /* continue after the regexp */
diff --git a/src/version.c b/src/version.c
index 38095cba..23a73484 100644
--- a/src/version.c
+++ b/src/version.c
@@ -667,6 +667,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 28,
+/**/
27,
/**/
26,