patch 8.1.2399: info popup on top of cursor if it doesn't fit
Problem: Info popup on top of cursor if it doesn't fit.
Solution: Hide the popup if it doesn't fit.
diff --git a/src/popupmenu.c b/src/popupmenu.c
index 14539ad..ceb72b4 100644
--- a/src/popupmenu.c
+++ b/src/popupmenu.c
@@ -661,7 +661,13 @@
// align with the selected item
row += pum_selected - pum_first + 1;
- popup_set_wantpos_rowcol(wp, row, col);
+ wp->w_popup_flags &= ~POPF_HIDDEN;
+ if (wp->w_maxwidth < 10)
+ // The popup is not going to fit or will overlap with the cursor
+ // position, hide the popup.
+ wp->w_popup_flags |= POPF_HIDDEN;
+ else
+ popup_set_wantpos_rowcol(wp, row, col);
}
#endif