From 485972dd64317e6a09ce7694cf0f903fb6d13cbd Mon Sep 17 00:00:00 2001 From: erw7 Date: Mon, 27 May 2019 19:05:11 +0900 Subject: vim-patch:8.1.0629: "gn" selects the wrong text with a multi-line match Problem: "gn" selects the wrong text with a multi-line match. Solution: Get the end position from searchit() directly. (closes vim/vim#3695) https://github.com/vim/vim/commit/5d24a2257e597fd752e33b2c1e9c19cf9114a517 --- src/nvim/edit.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/nvim/edit.c') diff --git a/src/nvim/edit.c b/src/nvim/edit.c index 5ac95b64e7..9af003f140 100644 --- a/src/nvim/edit.c +++ b/src/nvim/edit.c @@ -4045,13 +4045,15 @@ static int ins_compl_get_exp(pos_T *ini) if (CTRL_X_MODE_LINE_OR_EVAL(l_ctrl_x_mode) || (compl_cont_status & CONT_SOL)) { found_new_match = search_for_exact_line(ins_buf, pos, - compl_direction, compl_pattern); - } else - found_new_match = searchit(NULL, ins_buf, pos, + compl_direction, + compl_pattern); + } else { + found_new_match = searchit(NULL, ins_buf, pos, NULL, compl_direction, compl_pattern, 1L, SEARCH_KEEP + SEARCH_NFMSG, RE_LAST, (linenr_T)0, NULL, NULL); + } msg_silent--; if (!compl_started || set_match_pos) { /* set "compl_started" even on fail */ -- cgit