0
0
mirror of https://github.com/vim/vim.git synced 2025-09-29 04:34:16 -04:00

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.
This commit is contained in:
Bram Moolenaar
2019-12-06 20:17:35 +01:00
parent 9a838fe543
commit bef93ac9db
4 changed files with 69 additions and 1 deletions

View File

@@ -661,7 +661,13 @@ pum_position_info_popup(win_T *wp)
// 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