diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-05-10 07:58:58 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-10 07:58:58 +0800 |
commit | 9aa5647e686e5420e5b9b51828ec7d55631f98ed (patch) | |
tree | 81172459aa5b8ac5c1f2e4e0b322e70267712ecd /src/nvim/menu.c | |
parent | c55867b46d6758c4ff2e55d1bfb4cfc163182a12 (diff) | |
download | rneovim-9aa5647e686e5420e5b9b51828ec7d55631f98ed.tar.gz rneovim-9aa5647e686e5420e5b9b51828ec7d55631f98ed.tar.bz2 rneovim-9aa5647e686e5420e5b9b51828ec7d55631f98ed.zip |
vim-patch:8.2.4911: the mode #defines are not clearly named (#18499)
Problem: The mode #defines are not clearly named.
Solution: Prepend MODE_. Renumber them to put the mapped modes first.
https://github.com/vim/vim/commit/249591057b4840785c50e41dd850efb8a8faf435
A hunk from the patch depends on patch 8.2.4861, which hasn't been
ported yet, but that should be easy to notice.
Diffstat (limited to 'src/nvim/menu.c')
-rw-r--r-- | src/nvim/menu.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/nvim/menu.c b/src/nvim/menu.c index 192bed76ef..887a24d28b 100644 --- a/src/nvim/menu.c +++ b/src/nvim/menu.c @@ -1382,16 +1382,16 @@ static void execute_menu(const exarg_T *eap, vimmenu_T *menu) char *mode; // Use the Insert mode entry when returning to Insert mode. - if (((State & INSERT) || restart_edit) && !current_sctx.sc_sid) { + if (((State & MODE_INSERT) || restart_edit) && !current_sctx.sc_sid) { mode = "Insert"; idx = MENU_INDEX_INSERT; - } else if (State & CMDLINE) { + } else if (State & MODE_CMDLINE) { mode = "Command"; idx = MENU_INDEX_CMDLINE; - } else if (get_real_state() & VISUAL) { - /* Detect real visual mode -- if we are really in visual mode we - * don't need to do any guesswork to figure out what the selection - * is. Just execute the visual binding for the menu. */ + } else if (get_real_state() & MODE_VISUAL) { + // Detect real visual mode -- if we are really in visual mode we + // don't need to do any guesswork to figure out what the selection + // is. Just execute the visual binding for the menu. mode = "Visual"; idx = MENU_INDEX_VISUAL; } else if (eap != NULL && eap->addr_count) { |