diff options
author | zeertzjq <zeertzjq@outlook.com> | 2024-12-19 07:59:03 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-12-18 23:59:03 +0000 |
commit | 02bc40c19401ea9f7529cbc81bd18bd01c39bb3c (patch) | |
tree | a1995161f84fe7d580aa458aedd5c1bd87df702c /src/nvim/insexpand.c | |
parent | 160cbd0ef4c905b849beb969e8b5a56064c7cea7 (diff) | |
download | rneovim-02bc40c19401ea9f7529cbc81bd18bd01c39bb3c.tar.gz rneovim-02bc40c19401ea9f7529cbc81bd18bd01c39bb3c.tar.bz2 rneovim-02bc40c19401ea9f7529cbc81bd18bd01c39bb3c.zip |
vim-patch:9.1.0945: ComplMatchIns highlight doesn't end after inserted text (#31628)
Problem: ComplMatchIns highlight doesn't end after inserted text.
Solution: Handle ComplMatchIns highlight more like search highlight.
Fix off-by-one error. Handle deleting text properly.
(zeertzjq)
closes: vim/vim#16244
https://github.com/vim/vim/commit/f25d8f9312a24da2727671560a865888812ab8d9
Diffstat (limited to 'src/nvim/insexpand.c')
-rw-r--r-- | src/nvim/insexpand.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/nvim/insexpand.c b/src/nvim/insexpand.c index 5036ec5e45..872ed2b4c3 100644 --- a/src/nvim/insexpand.c +++ b/src/nvim/insexpand.c @@ -958,7 +958,7 @@ static void ins_compl_insert_bytes(char *p, int len) } assert(len >= 0); ins_bytes_len(p, (size_t)len); - compl_ins_end_col = curwin->w_cursor.col - 1; + compl_ins_end_col = curwin->w_cursor.col; } /// Checks if the column is within the currently inserted completion text @@ -2147,6 +2147,8 @@ static bool ins_compl_stop(const int c, const int prev_mode, bool retval) && pum_visible()) { word = xstrdup(compl_shown_match->cp_str); retval = true; + // May need to remove ComplMatchIns highlight. + redrawWinline(curwin, curwin->w_cursor.lnum); } // CTRL-E means completion is Ended, go back to the typed text. @@ -3648,6 +3650,7 @@ void ins_compl_delete(bool new_leader) return; } backspace_until_column(col); + compl_ins_end_col = curwin->w_cursor.col; } // TODO(vim): is this sufficient for redrawing? Redrawing everything |