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

patch 9.0.1480: using popup menu may leave text in the command line

Problem:    Using popup menu may leave text in the command line.
Solution:   Clear the command line if the popup menu covered it. (Luuk van
            Baal, closes #12286)
This commit is contained in:
Luuk van Baal
2023-04-23 16:24:08 +01:00
committed by Bram Moolenaar
parent f39d9e9dca
commit dcd40cfca0
4 changed files with 35 additions and 0 deletions

View File

@@ -18,6 +18,7 @@ static int pum_selected; // index of selected item or -1
static int pum_first = 0; // index of top item
static int call_update_screen = FALSE;
static int pum_in_cmdline = FALSE;
static int pum_height; // nr of displayed pum items
static int pum_width; // width of displayed pum items
@@ -1067,6 +1068,11 @@ pum_undisplay(void)
pum_array = NULL;
redraw_all_later(UPD_NOT_VALID);
redraw_tabline = TRUE;
if (pum_in_cmdline)
{
clear_cmdline = TRUE;
pum_in_cmdline = FALSE;
}
status_redraw_all();
#if defined(FEAT_PROP_POPUP) && defined(FEAT_QUICKFIX)
// hide any popup info window
@@ -1193,6 +1199,8 @@ pum_position_at_mouse(int min_width)
pum_row = mouse_row + 1;
if (pum_height > Rows - pum_row)
pum_height = Rows - pum_row;
if (pum_row + pum_height > cmdline_row)
pum_in_cmdline = TRUE;
}
else
{