From 476c50903a38a2ab85546c6f061117950d6e79fc Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Sun, 13 Sep 2020 01:33:53 -0400 Subject: vim-patch:8.1.0499: :2vimgrep causes an ml_get error Problem: :2vimgrep causes an ml_get error Solution: Pass tomatch pointer instead of value. (Yegappan Lakshmanan) https://github.com/vim/vim/commit/1c29943416207e21abbc790eaf563b36789170c2 --- src/nvim/ex_getln.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/nvim/ex_getln.c') diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c index c966c780a0..fe52a6cfa7 100644 --- a/src/nvim/ex_getln.c +++ b/src/nvim/ex_getln.c @@ -443,6 +443,10 @@ static void may_do_incsearch_highlighting(int firstc, long count, if (search_first_line == 0) { // start at the original cursor position curwin->w_cursor = s->search_start; + } else if (search_first_line > curbuf->b_ml.ml_line_count) { + // start after the last line + curwin->w_cursor.lnum = curbuf->b_ml.ml_line_count; + curwin->w_cursor.col = MAXCOL; } else { // start at the first line in the range curwin->w_cursor.lnum = search_first_line; -- cgit From 25992df761f24546df69aa01fd03d0ae96e96fbe Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Sun, 13 Sep 2020 01:52:24 -0400 Subject: 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) https://github.com/vim/vim/commit/730f48fe3691dc62331f3df23cb947bfc33a5add --- src/nvim/ex_getln.c | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'src/nvim/ex_getln.c') diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c index fe52a6cfa7..68d4c57c65 100644 --- a/src/nvim/ex_getln.c +++ b/src/nvim/ex_getln.c @@ -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; -- cgit From 8105fc89c40cd702b44f53a979f17161318c1294 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Sun, 13 Sep 2020 02:03:03 -0400 Subject: vim-patch:8.1.1704: C-R C-W does not work after C-G when using 'incsearch' Problem: C-R C-W does not work after C-G when using 'incsearch'. Solution: Put cursor at end of the match. (Yasuhiro Matsumoto, closes vim/vim#4664) https://github.com/vim/vim/commit/69a5b867940d25f68a782de5c1165d65b51fcafa --- src/nvim/ex_getln.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/nvim/ex_getln.c') diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c index 68d4c57c65..8f2d536e63 100644 --- a/src/nvim/ex_getln.c +++ b/src/nvim/ex_getln.c @@ -276,6 +276,7 @@ static void init_incsearch_state(incsearch_state_T *s) // Sets search_first_line and search_last_line to the address range. static bool do_incsearch_highlighting(int firstc, incsearch_state_T *s, int *skiplen, int *patlen) + FUNC_ATTR_NONNULL_ALL { char_u *cmd; cmdmod_T save_cmdmod = cmdmod; @@ -1447,6 +1448,7 @@ static int command_line_execute(VimState *state, int key) static int may_do_command_line_next_incsearch(int firstc, long count, incsearch_state_T *s, bool next_match) + FUNC_ATTR_NONNULL_ALL { int skiplen, patlen; @@ -1540,6 +1542,7 @@ static int may_do_command_line_next_incsearch(int firstc, long count, save_viewstate(&s->old_viewstate); update_screen(NOT_VALID); redrawcmdline(); + curwin->w_cursor = s->match_end; } else { vim_beep(BO_ERROR); } -- cgit