diff options
author | Ömer Sinan Ağacan <omeragacan@gmail.com> | 2017-11-03 08:28:36 +0300 |
---|---|---|
committer | Ömer Sinan Ağacan <omeragacan@gmail.com> | 2018-01-26 18:39:20 +0300 |
commit | cd973be11bfcdee286017f83e04c3d6c3be2f19a (patch) | |
tree | 23d15499d1864efec77bfcb9687e9034ea6452dc /src/nvim/ex_getln.c | |
parent | 41394d82365b504c89bb4da9ed5adc11c6f619f0 (diff) | |
download | rneovim-cd973be11bfcdee286017f83e04c3d6c3be2f19a.tar.gz rneovim-cd973be11bfcdee286017f83e04c3d6c3be2f19a.tar.bz2 rneovim-cd973be11bfcdee286017f83e04c3d6c3be2f19a.zip |
vim-patch:8.0.1250
Problem: 'hlsearch' highlighting not removed after incsearch (lacygoill)
Solution: Redraw all windows. Start search at the end of the match. Improve
how CTRL-G works with incremental search. Add tests. (Christian
Brabandt, Hirohito Higashi, haya14busa, closes vim/vim#2267)
https://github.com/vim/vim/commit/f8f8b2eadbaf3090fcfccbab560de5dbd501833d
Diffstat (limited to 'src/nvim/ex_getln.c')
-rw-r--r-- | src/nvim/ex_getln.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c index 81c6854459..692a8893ae 100644 --- a/src/nvim/ex_getln.c +++ b/src/nvim/ex_getln.c @@ -426,7 +426,7 @@ static uint8_t *command_line_enter(int firstc, long count, int indent) curwin->w_botline = s->old_botline; highlight_match = false; validate_cursor(); // needed for TAB - redraw_later(SOME_VALID); + redraw_all_later(SOME_VALID); } if (ccline.cmdbuff != NULL) { @@ -1024,6 +1024,11 @@ static void command_line_next_incsearch(CommandLineState *s, bool next_match) if (next_match) { t = s->match_end; + if (lt(s->match_start, s->match_end)) { + // start searching at the end of the match + // not at the beginning of the next column + (void)decl(&t); + } search_flags += SEARCH_COL; } else { t = s->match_start; @@ -1662,7 +1667,9 @@ static int command_line_handle_key(CommandLineState *s) if (char_avail()) { return 1; } - command_line_next_incsearch(s, s->c == Ctrl_G); + if (ccline.cmdlen != 0) { + command_line_next_incsearch(s, s->c == Ctrl_G); + } return command_line_not_changed(s); } break; @@ -1785,6 +1792,7 @@ static int command_line_changed(CommandLineState *s) if (ccline.cmdlen == 0) { s->i = 0; SET_NO_HLSEARCH(true); // turn off previous highlight + redraw_all_later(SOME_VALID); } else { int search_flags = SEARCH_OPT + SEARCH_NOOF + SEARCH_PEEK; ui_busy_start(); |