0
0
mirror of https://github.com/vim/vim.git synced 2025-11-16 23:24:03 -05:00

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: #16284
closes: #16283

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
glepnir
2024-12-24 09:44:35 +01:00
committed by Christian Brabandt
parent f07c10d7bb
commit 8d0bb6dc9f
7 changed files with 66 additions and 5 deletions

View File

@@ -1864,6 +1864,23 @@ ins_compl_active(void)
return compl_started;
}
/*
* Return True when wp is the actual completion window
*/
int
ins_compl_win_active(win_T *wp UNUSED)
{
return ins_compl_active()
#if defined(FEAT_QUICKFIX)
&& (!wp->w_p_pvw
# ifdef FEAT_PROP_POPUP
&& !(wp->w_popup_flags & POPF_INFO)
# endif
)
#endif
;
}
/*
* Selected one of the matches. When FALSE the match was edited or using the
* longest common string.