Mercurial > vim
comparison src/normal.c @ 10098:72e4b7f90465 v7.4.2320
commit https://github.com/vim/vim/commit/dda933d06c06c2792bd686d059f6ad19191ad30b
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Sep 3 21:04:58 2016 +0200
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.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 03 Sep 2016 21:15:06 +0200 |
parents | 4aead6a9b7a9 |
children | cfb38b57d407 |
comparison
equal
deleted
inserted
replaced
10097:26ade1c95bd9 | 10098:72e4b7f90465 |
---|---|
6226 */ | 6226 */ |
6227 static void | 6227 static void |
6228 nv_search(cmdarg_T *cap) | 6228 nv_search(cmdarg_T *cap) |
6229 { | 6229 { |
6230 oparg_T *oap = cap->oap; | 6230 oparg_T *oap = cap->oap; |
6231 pos_T save_cursor = curwin->w_cursor; | |
6231 | 6232 |
6232 if (cap->cmdchar == '?' && cap->oap->op_type == OP_ROT13) | 6233 if (cap->cmdchar == '?' && cap->oap->op_type == OP_ROT13) |
6233 { | 6234 { |
6234 /* Translate "g??" to "g?g?" */ | 6235 /* Translate "g??" to "g?g?" */ |
6235 cap->cmdchar = 'g'; | 6236 cap->cmdchar = 'g'; |
6236 cap->nchar = '?'; | 6237 cap->nchar = '?'; |
6237 nv_operator(cap); | 6238 nv_operator(cap); |
6238 return; | 6239 return; |
6239 } | 6240 } |
6240 | 6241 |
6242 /* When using 'incsearch' the cursor may be moved to set a different search | |
6243 * start position. */ | |
6241 cap->searchbuf = getcmdline(cap->cmdchar, cap->count1, 0); | 6244 cap->searchbuf = getcmdline(cap->cmdchar, cap->count1, 0); |
6242 | 6245 |
6243 if (cap->searchbuf == NULL) | 6246 if (cap->searchbuf == NULL) |
6244 { | 6247 { |
6245 clearop(oap); | 6248 clearop(oap); |
6246 return; | 6249 return; |
6247 } | 6250 } |
6248 | 6251 |
6249 (void)normal_search(cap, cap->cmdchar, cap->searchbuf, | 6252 (void)normal_search(cap, cap->cmdchar, cap->searchbuf, |
6250 (cap->arg ? 0 : SEARCH_MARK)); | 6253 (cap->arg || !equalpos(save_cursor, curwin->w_cursor)) |
6254 ? 0 : SEARCH_MARK); | |
6251 } | 6255 } |
6252 | 6256 |
6253 /* | 6257 /* |
6254 * Handle "N" and "n" commands. | 6258 * Handle "N" and "n" commands. |
6255 * cap->arg is SEARCH_REV for "N", 0 for "n". | 6259 * cap->arg is SEARCH_REV for "N", 0 for "n". |