diff options
author | James McCoy <jamessan@jamessan.com> | 2017-06-25 12:15:58 -0400 |
---|---|---|
committer | James McCoy <jamessan@jamessan.com> | 2017-06-26 22:08:13 -0400 |
commit | 54d5e90a2b87736a3248300ed423374e88ce8e79 (patch) | |
tree | 7953336c8a7542a0107082233a08c15874d0c3a9 /src/nvim/normal.c | |
parent | 3679752dbd9191f4067a43143da637478cc389f1 (diff) | |
download | rneovim-54d5e90a2b87736a3248300ed423374e88ce8e79.tar.gz rneovim-54d5e90a2b87736a3248300ed423374e88ce8e79.tar.bz2 rneovim-54d5e90a2b87736a3248300ed423374e88ce8e79.zip |
vim-patch:7.4.2320
Problem: Redraw problem when using 'incsearch'.
Solution: Save the current view when deleting characters. (Christian
Brabandt) Fix that the '" mark is set in the wrong position. Don't
change the search start when using BS.
https://github.com/vim/vim/commit/dda933d06c06c2792bd686d059f6ad19191ad30b
Diffstat (limited to 'src/nvim/normal.c')
-rw-r--r-- | src/nvim/normal.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/nvim/normal.c b/src/nvim/normal.c index 050020d79d..39cd2c6631 100644 --- a/src/nvim/normal.c +++ b/src/nvim/normal.c @@ -5231,6 +5231,7 @@ static void nv_dollar(cmdarg_T *cap) static void nv_search(cmdarg_T *cap) { oparg_T *oap = cap->oap; + pos_T save_cursor = curwin->w_cursor; if (cap->cmdchar == '?' && cap->oap->op_type == OP_ROT13) { /* Translate "g??" to "g?g?" */ @@ -5240,6 +5241,8 @@ static void nv_search(cmdarg_T *cap) return; } + // When using 'incsearch' the cursor may be moved to set a different search + // start position. cap->searchbuf = getcmdline(cap->cmdchar, cap->count1, 0); if (cap->searchbuf == NULL) { @@ -5248,7 +5251,8 @@ static void nv_search(cmdarg_T *cap) } (void)normal_search(cap, cap->cmdchar, cap->searchbuf, - (cap->arg ? 0 : SEARCH_MARK)); + (cap->arg || !equalpos(save_cursor, curwin->w_cursor)) + ? 0 : SEARCH_MARK); } /* |