From 60abe75379f8b7c2076856c5f12ce2e7650110f6 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Thu, 7 Mar 2013 16:32:54 +0100 Subject: =?UTF-8?q?updated=20for=20version=207.3.850=20Problem:=20=20=20?= =?UTF-8?q?=20":vimgrep=20//"=20matches=20everywhere.=20Solution:=20=20=20?= =?UTF-8?q?Make=20it=20use=20the=20previous=20search=20pattern.=20(David?= =?UTF-8?q?=20B=C3=BCrgin)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/quickfix.c | 15 ++++++++++++++- src/version.c | 2 ++ 2 files changed, 16 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/quickfix.c b/src/quickfix.c index 2f8155a4c..0de6fe0b1 100644 --- a/src/quickfix.c +++ b/src/quickfix.c @@ -3179,7 +3179,20 @@ ex_vimgrep(eap) EMSG(_(e_invalpat)); goto theend; } - regmatch.regprog = vim_regcomp(s, RE_MAGIC); + + if (s != NULL && *s == NUL) + { + /* Pattern is empty, use last search pattern. */ + if (last_search_pat() == NULL) + { + EMSG(_(e_noprevre)); + goto theend; + } + regmatch.regprog = vim_regcomp(last_search_pat(), RE_MAGIC); + } + else + regmatch.regprog = vim_regcomp(s, RE_MAGIC); + if (regmatch.regprog == NULL) goto theend; regmatch.rmm_ic = p_ic; diff --git a/src/version.c b/src/version.c index 9b90b51e6..b4234e0a3 100644 --- a/src/version.c +++ b/src/version.c @@ -728,6 +728,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 850, /**/ 849, /**/ -- cgit v1.2.1