1
0
forked from aniani/vim

patch 8.0.1570: can't use :popup for a menu in the terminal

Problem:    Can't use :popup for a menu in the terminal. (Wei Zhang)
Solution:   Make :popup work in the terminal.  Also fix that entries were
            included that don't work in the current state.
This commit is contained in:
Bram Moolenaar
2018-03-05 21:06:23 +01:00
parent 28ada699c1
commit 29a2c08d79
6 changed files with 53 additions and 12 deletions

View File

@@ -1891,6 +1891,16 @@ get_menu_mode(void)
return MENU_INDEX_INVALID;
}
int
get_menu_mode_flag(void)
{
int mode = get_menu_mode();
if (mode == MENU_INDEX_INVALID)
return 0;
return 1 << mode;
}
/*
* Display the Special "PopUp" menu as a pop-up at the current mouse
* position. The "PopUpn" menu is for Normal mode, "PopUpi" for Insert mode,
@@ -2044,13 +2054,7 @@ gui_update_menus(int modes)
if (modes != 0x0)
mode = modes;
else
{
mode = get_menu_mode();
if (mode == MENU_INDEX_INVALID)
mode = 0;
else
mode = (1 << mode);
}
mode = get_menu_mode_flag();
if (force_menu_update || mode != prev_mode)
{