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)
diff --git a/src/popupmenu.c b/src/popupmenu.c
index ea52d80..d713ed4 100644
--- a/src/popupmenu.c
+++ b/src/popupmenu.c
@@ -238,13 +238,16 @@
// 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)