summaryrefslogtreecommitdiffstats
path: root/src/ex_getln.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2017-11-16 22:20:39 +0100
committerBram Moolenaar <Bram@vim.org>2017-11-16 22:20:39 +0100
commitd0480097177369a6ed91d47aba189ae647afcd68 (patch)
tree843535035064603b175733322adad326163a735c /src/ex_getln.c
parent9c6ce0e62297294b41344e684429a91853bc2268 (diff)
patch 8.0.1304: CTRL-G/CTRL-T don't work with incsearch and empty patternv8.0.1304
Problem: CTRL-G/CTRL-T don't work with incsearch and empty pattern. Solution: Use the last search pattern. (Christian Brabandt, closes #2292)
Diffstat (limited to 'src/ex_getln.c')
-rw-r--r--src/ex_getln.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/ex_getln.c b/src/ex_getln.c
index 0270477283..7c0db89a87 100644
--- a/src/ex_getln.c
+++ b/src/ex_getln.c
@@ -220,7 +220,7 @@ getcmdline(
pos_T match_end;
# ifdef FEAT_DIFF
int old_topfill;
- int init_topfill = curwin->w_topfill;
+ int init_topfill = curwin->w_topfill;
# endif
linenr_T old_botline;
linenr_T init_botline = curwin->w_botline;
@@ -1715,11 +1715,17 @@ getcmdline(
if (p_is && !cmd_silent && (firstc == '/' || firstc == '?'))
{
pos_T t;
+ char_u *pat;
int search_flags = SEARCH_NOOF;
if (ccline.cmdlen == 0)
goto cmdline_not_changed;
+ if (firstc == ccline.cmdbuff[0])
+ pat = last_search_pattern();
+ else
+ pat = ccline.cmdbuff;
+
save_last_search_pattern();
cursor_off();
out_flush();
@@ -1739,7 +1745,7 @@ getcmdline(
++emsg_off;
i = searchit(curwin, curbuf, &t,
c == Ctrl_G ? FORWARD : BACKWARD,
- ccline.cmdbuff, count, search_flags,
+ pat, count, search_flags,
RE_SEARCH, 0, NULL, NULL);
--emsg_off;
if (i)