diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-12-06 20:17:35 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-12-06 20:17:35 +0100 |
commit | bef93ac9dbfb98193ddb315c50523f1af01a517d (patch) | |
tree | e20d644144916affab27f34da5631827aac9268d /src/popupmenu.c | |
parent | 9a838fe543b69582b0773f7c38a57f16fb32d765 (diff) | |
download | vim-git-bef93ac9dbfb98193ddb315c50523f1af01a517d.tar.gz |
patch 8.1.2399: info popup on top of cursor if it doesn't fitv8.1.2399
Problem: Info popup on top of cursor if it doesn't fit.
Solution: Hide the popup if it doesn't fit.
Diffstat (limited to 'src/popupmenu.c')
-rw-r--r-- | src/popupmenu.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/popupmenu.c b/src/popupmenu.c index 14539adf2..ceb72b4f2 100644 --- a/src/popupmenu.c +++ b/src/popupmenu.c @@ -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 |