]> granicus.if.org Git - vim/commitdiff
updated for version 7.1-028 v7.1.028
authorBram Moolenaar <Bram@vim.org>
Tue, 10 Jul 2007 15:26:20 +0000 (15:26 +0000)
committerBram Moolenaar <Bram@vim.org>
Tue, 10 Jul 2007 15:26:20 +0000 (15:26 +0000)
runtime/doc/change.txt
src/ex_cmds.c
src/version.c

index e82256dfa059298e55f7b725263434aa23a204e6..c1eed2c0a43811452b75529f7df9ad34252820b5 100644 (file)
@@ -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.
 
index 5ca3dfd07de7788d470b7b0806aa634ee7c8773c..66bbb188df1643d2c9074941c2fc9251d6d7ecc5 100644 (file)
@@ -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 */
index 38095cbac285e2fbb15e85357e3e1eb56719a517..23a73484e000490ff5913e1d74ca39555524dd04 100644 (file)
@@ -666,6 +666,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    28,
 /**/
     27,
 /**/