4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=ISO-8859-1
7 Content-Transfer-Encoding: 8bit
11 Problem: Can't use last search pattern for ":sort". (Brian McKee)
12 Solution: When the pattern is emtpy use the last search pattern. (Martin
14 Files: runtime/doc/change.txt, src/ex_cmds.c
17 *** ../vim-7.1.027/runtime/doc/change.txt Sat May 12 16:10:12 2007
18 --- runtime/doc/change.txt Tue Jul 10 11:30:56 2007
22 in their original order, right before the sorted
25 + If {pattern} is empty (e.g. // is specified), the
26 + last search pattern is used. This allows trying out
29 Note that using ":sort" with ":global" doesn't sort the matching lines, it's
32 *** ../vim-7.1.027/src/ex_cmds.c Thu Jun 28 21:57:08 2007
33 --- src/ex_cmds.c Tue Jul 10 17:25:10 2007
39 ! regmatch.regprog = vim_regcomp(p + 1, RE_MAGIC);
40 if (regmatch.regprog == NULL)
42 p = s; /* continue after the regexp */
47 ! /* Use last search pattern if sort pattern is empty. */
48 ! if (s == p + 1 && last_search_pat() != NULL)
49 ! regmatch.regprog = vim_regcomp(last_search_pat(), RE_MAGIC);
51 ! regmatch.regprog = vim_regcomp(p + 1, RE_MAGIC);
52 if (regmatch.regprog == NULL)
54 p = s; /* continue after the regexp */
55 *** ../vim-7.1.027/src/version.c Tue Jul 10 17:09:51 2007
56 --- src/version.c Tue Jul 10 17:20:01 2007
60 { /* Add new patch number below this line */
66 Every person is responsible for the choices he makes.
68 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
69 /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
70 \\\ download, build and distribute -- http://www.A-A-P.org ///
71 \\\ help me help AIDS victims -- http://ICCF-Holland.org ///