aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/change.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2024-06-19 07:42:56 +0800
committerzeertzjq <zeertzjq@outlook.com>2024-06-19 08:02:29 +0800
commita2a3e8412e6d4e9a952c57a5298016cae8bf5229 (patch)
tree4c606a997f28a74b531ab2888e2f59eac5329d70 /src/nvim/change.c
parent14aba679670a6485596c60fa5eb1df92ecae8a1b (diff)
downloadrneovim-a2a3e8412e6d4e9a952c57a5298016cae8bf5229.tar.gz
rneovim-a2a3e8412e6d4e9a952c57a5298016cae8bf5229.tar.bz2
rneovim-a2a3e8412e6d4e9a952c57a5298016cae8bf5229.zip
vim-patch:8.2.5047: CurSearch highlight is often wrong
Problem: CurSearch highlight is often wrong. Solution: Remember the last highlighted position and redraw when needed. https://github.com/vim/vim/commit/368137aa525982984beed73940af481ac53a62af Co-authored-by: Bram Moolenaar <Bram@vim.org>
Diffstat (limited to 'src/nvim/change.c')
-rw-r--r--src/nvim/change.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/nvim/change.c b/src/nvim/change.c
index 6c979df1fe..428a9187c8 100644
--- a/src/nvim/change.c
+++ b/src/nvim/change.c
@@ -392,6 +392,10 @@ static void changed_common(buf_T *buf, linenr_T lnum, colnr_T col, linenr_T lnum
}
}
}
+
+ if (wp == curwin && xtra != 0 && search_hl_has_cursor_lnum >= lnum) {
+ search_hl_has_cursor_lnum += xtra;
+ }
}
// Call update_screen() later, which checks out what needs to be redrawn,