aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/drawline.c
diff options
context:
space:
mode:
authorglepnir <glephunter@gmail.com>2024-12-24 18:12:50 +0800
committerzeertzjq <zeertzjq@outlook.com>2024-12-24 18:56:40 +0800
commit05eca4c04d4d2cc6ad3a2af69d76085135e9b16c (patch)
treefe4fea9e86bcd74a70b2e0ea7590bd07f69a412b /src/nvim/drawline.c
parenta103ec7449c4a318788b519cdeac2e525136b66b (diff)
downloadrneovim-05eca4c04d4d2cc6ad3a2af69d76085135e9b16c.tar.gz
rneovim-05eca4c04d4d2cc6ad3a2af69d76085135e9b16c.tar.bz2
rneovim-05eca4c04d4d2cc6ad3a2af69d76085135e9b16c.zip
vim-patch:9.1.0956: completion may crash, completion highlight wrong with preview window
Problem: completion may crash, completion highlight wrong with preview window (after v9.1.0954) Solution: correctly calculate scroll offset, check for preview window when adding extra highlighting (glepnir) when there have a preview window prepare_tagpreview will change curwin to preview window and this may cause ComplMatchIns check condition not correct. check wp is curwin and also the type of wp is not a preview or poup info fixes: https://github.com/vim/vim/issues/16284 closes: https://github.com/vim/vim/pull/16283 https://github.com/vim/vim/commit/8d0bb6dc9f2e5d94ebb59671d592c1b7fa325ca6
Diffstat (limited to 'src/nvim/drawline.c')
-rw-r--r--src/nvim/drawline.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/nvim/drawline.c b/src/nvim/drawline.c
index 35a41f840d..3062b0f2a3 100644
--- a/src/nvim/drawline.c
+++ b/src/nvim/drawline.c
@@ -1495,7 +1495,7 @@ int win_line(win_T *wp, linenr_T lnum, int startrow, int endrow, int col_rows, s
ptr = line + v; // "line" may have been updated
}
- if ((State & MODE_INSERT) && in_curline && ins_compl_active()) {
+ if ((State & MODE_INSERT) && in_curline && ins_compl_win_active(wp)) {
area_highlighting = true;
}
@@ -1746,7 +1746,7 @@ int win_line(win_T *wp, linenr_T lnum, int startrow, int endrow, int col_rows, s
}
// Check if ComplMatchIns highlight is needed.
- if ((State & MODE_INSERT) && in_curline && ins_compl_active()) {
+ if ((State & MODE_INSERT) && in_curline && ins_compl_win_active(wp)) {
int ins_match_attr = ins_compl_col_range_attr((int)(ptr - line));
if (ins_match_attr > 0) {
search_attr = hl_combine_attr(search_attr, ins_match_attr);