0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

updated for version 7.1-028

This commit is contained in:
Bram Moolenaar
2007-07-10 15:26:20 +00:00
parent fe1c56d6ae
commit 1256e720f5
3 changed files with 11 additions and 1 deletions

View 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 */