mirror of
https://github.com/neovim/neovim.git
synced 2025-09-15 07:48:18 +00:00
vim-patch:8.1.1148: CTRL-L with 'incsearch' does not pick up char under cursor
Problem: CTRL-L with 'incsearch' does not pick up char under cursor.
(Smylers)
Solution: Do not compare the position with the cursor position. (Hirohito
Higashi, closes vim/vim#3620)
730f48fe36
This commit is contained in:
@@ -567,6 +567,7 @@ static void may_do_incsearch_highlighting(int firstc, long count,
|
||||
// May set "*c" to the added character.
|
||||
// Return OK when calling command_line_not_changed.
|
||||
static int may_add_char_to_search(int firstc, int *c, incsearch_state_T *s)
|
||||
FUNC_ATTR_NONNULL_ALL
|
||||
{
|
||||
int skiplen, patlen;
|
||||
|
||||
@@ -583,8 +584,8 @@ static int may_add_char_to_search(int firstc, int *c, incsearch_state_T *s)
|
||||
|
||||
if (s->did_incsearch) {
|
||||
curwin->w_cursor = s->match_end;
|
||||
if (!equalpos(curwin->w_cursor, s->search_start)) {
|
||||
*c = gchar_cursor();
|
||||
*c = gchar_cursor();
|
||||
if (*c != NUL) {
|
||||
// If 'ignorecase' and 'smartcase' are set and the
|
||||
// command line has no uppercase characters, convert
|
||||
// the character to lowercase
|
||||
@@ -592,16 +593,14 @@ static int may_add_char_to_search(int firstc, int *c, incsearch_state_T *s)
|
||||
&& !pat_has_uppercase(ccline.cmdbuff + skiplen)) {
|
||||
*c = mb_tolower(*c);
|
||||
}
|
||||
if (*c != NUL) {
|
||||
if (*c == firstc
|
||||
|| vim_strchr((char_u *)(p_magic ? "\\~^$.*[" : "\\^$"), *c)
|
||||
!= NULL) {
|
||||
// put a backslash before special characters
|
||||
stuffcharReadbuff(*c);
|
||||
*c = '\\';
|
||||
}
|
||||
return FAIL;
|
||||
if (*c == firstc
|
||||
|| vim_strchr((char_u *)(p_magic ? "\\~^$.*[" : "\\^$"), *c)
|
||||
!= NULL) {
|
||||
// put a backslash before special characters
|
||||
stuffcharReadbuff(*c);
|
||||
*c = '\\';
|
||||
}
|
||||
return FAIL;
|
||||
}
|
||||
}
|
||||
return OK;
|
||||
|
Reference in New Issue
Block a user