diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2018-02-01 23:50:12 +0100 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2018-02-11 15:27:56 +0100 |
commit | 7d12597d29e60239fd5c586417b48982893c174e (patch) | |
tree | 67416148d5c470635370494a621568df6ec93e3b /src/nvim/ex_getln.c | |
parent | ca24ad0b95c7f6360b3c4b732911558361bff3fe (diff) | |
download | rneovim-7d12597d29e60239fd5c586417b48982893c174e.tar.gz rneovim-7d12597d29e60239fd5c586417b48982893c174e.tar.bz2 rneovim-7d12597d29e60239fd5c586417b48982893c174e.zip |
vim-patch:8.0.0692: CTRL-G with 'incsearch' and ? goes in the wrong direction
Problem: Using CTRL-G with 'incsearch' and ? goes in the wrong direction.
(Ramel Eshed)
Solution: Adjust search_start. (Christian Brabandt)
https://github.com/vim/vim/commit/da5116da4586fc714434411d2cccb066caa3723e
Diffstat (limited to 'src/nvim/ex_getln.c')
-rw-r--r-- | src/nvim/ex_getln.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c index bbe1d22473..c99ae687bb 100644 --- a/src/nvim/ex_getln.c +++ b/src/nvim/ex_getln.c @@ -1063,6 +1063,13 @@ static void command_line_next_incsearch(CommandLineState *s, bool next_match) s->search_start = t; (void)decl(&s->search_start); } + else if (next_match && s->firstc == '?') { + // move just after the current match, so that + // when nv_search finishes the cursor will be + // put back on the match + s->search_start = t; + (void)incl(&s->search_start); + } if (lt(t, s->search_start) && next_match) { // wrap around s->search_start = t; |