diff options
author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2020-03-14 07:13:35 -0400 |
---|---|---|
committer | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2020-04-26 19:17:16 -0400 |
commit | 7d028f07657f1839819f81bade576591d2a778f9 (patch) | |
tree | 40a2c1897e07c24f8b4a50486e859cf5c39b8319 | |
parent | 9758f5e5087a046fe8b624a3e64bdae020bbfe99 (diff) | |
download | rneovim-7d028f07657f1839819f81bade576591d2a778f9.tar.gz rneovim-7d028f07657f1839819f81bade576591d2a778f9.tar.bz2 rneovim-7d028f07657f1839819f81bade576591d2a778f9.zip |
vim-patch:8.0.1142: window toolbar menu gets a tear-off item
Problem: Window toolbar menu gets a tear-off item.
Solution: Recognize the window toolbar.
https://github.com/vim/vim/commit/378daf87d380b9f3c4f822786dfbfdcad9ca2db9
-rw-r--r-- | src/nvim/menu.c | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/src/nvim/menu.c b/src/nvim/menu.c index 65fd211adc..b43a24d0a9 100644 --- a/src/nvim/menu.c +++ b/src/nvim/menu.c @@ -51,7 +51,7 @@ static char_u e_nomenu[] = N_("E329: No menu \"%s\""); static bool menu_is_winbar(const char_u *const name) FUNC_ATTR_PURE FUNC_ATTR_WARN_UNUSED_RESULT FUNC_ATTR_NONNULL_ALL { - return (STRNCMP(name, "WinBar", 5) == 0); + return (STRNCMP(name, "WinBar", 6) == 0); } int winbar_height(const win_T *const wp) @@ -1361,29 +1361,27 @@ static char_u *menu_text(const char_u *str, int *mnemonic, char_u **actext) return text; } -/* - * Return TRUE if "name" can be a menu in the MenuBar. - */ -int menu_is_menubar(char_u *name) +// Return true if "name" can be a menu in the MenuBar. +bool menu_is_menubar(const char_u *const name) + FUNC_ATTR_PURE FUNC_ATTR_WARN_UNUSED_RESULT FUNC_ATTR_NONNULL_ALL { return !menu_is_popup(name) && !menu_is_toolbar(name) + && !menu_is_winbar(name) && *name != MNU_HIDDEN_CHAR; } -/* - * Return TRUE if "name" is a popup menu name. - */ -int menu_is_popup(char_u *name) +// Return true if "name" is a popup menu name. +bool menu_is_popup(const char_u *const name) + FUNC_ATTR_PURE FUNC_ATTR_WARN_UNUSED_RESULT FUNC_ATTR_NONNULL_ALL { return STRNCMP(name, "PopUp", 5) == 0; } -/* - * Return TRUE if "name" is a toolbar menu name. - */ -int menu_is_toolbar(char_u *name) +// Return true if "name" is a toolbar menu name. +bool menu_is_toolbar(const char_u *const name) + FUNC_ATTR_PURE FUNC_ATTR_WARN_UNUSED_RESULT FUNC_ATTR_NONNULL_ALL { return STRNCMP(name, "ToolBar", 7) == 0; } |