0
0
mirror of https://github.com/vim/vim.git synced 2025-11-10 10:47:23 -05:00

patch 9.0.1432: completion popup in wrong position with virtual text "above"

Problem:    Completion popup in wrong position with virtual text "above".
Solution:   Adjust the column. (closes #12210)
This commit is contained in:
Bram Moolenaar
2023-03-31 19:32:29 +01:00
parent 2d68b722e3
commit 6ac2e4392a
4 changed files with 43 additions and 5 deletions

View File

@@ -238,13 +238,16 @@ pum_display(
// cmdline completion popup menu
cursor_col = cmdline_compl_startcol();
else
{
// w_wcol includes virtual text "above"
int wcol = curwin->w_wcol % curwin->w_width;
#ifdef FEAT_RIGHTLEFT
if (right_left)
cursor_col = curwin->w_wincol + curwin->w_width
- curwin->w_wcol - 1;
else
if (right_left)
cursor_col = curwin->w_wincol + curwin->w_width - wcol - 1;
else
#endif
cursor_col = curwin->w_wincol + curwin->w_wcol;
cursor_col = curwin->w_wincol + wcol;
}
// if there are more items than room we need a scrollbar
if (pum_height < size)