summaryrefslogtreecommitdiff
path: root/src/menu.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2018-03-05 21:06:23 +0100
committerBram Moolenaar <Bram@vim.org>2018-03-05 21:06:23 +0100
commit29a2c08d792e4458a0af8371f5341394829fce29 (patch)
tree1b02aeac272844df0c3749454697dbf5a63f33cc /src/menu.c
parent28ada699c13833219acaeb7e768acc2acae50e02 (diff)
downloadvim-git-29a2c08d792e4458a0af8371f5341394829fce29.tar.gz
patch 8.0.1570: can't use :popup for a menu in the terminalv8.0.1570
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.
Diffstat (limited to 'src/menu.c')
-rw-r--r--src/menu.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/menu.c b/src/menu.c
index 107cabce6..c04cd49bb 100644
--- a/src/menu.c
+++ b/src/menu.c
@@ -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)
{