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.
378daf87d3
This commit is contained in:
Jan Edmund Lazo
2020-03-14 07:13:35 -04:00
parent 9758f5e508
commit 7d028f0765

View File

@@ -51,7 +51,7 @@ static char_u e_nomenu[] = N_("E329: No menu \"%s\"");
static bool menu_is_winbar(const char_u *const name) static bool menu_is_winbar(const char_u *const name)
FUNC_ATTR_PURE FUNC_ATTR_WARN_UNUSED_RESULT FUNC_ATTR_NONNULL_ALL 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) 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 text;
} }
/* // Return true if "name" can be a menu in the MenuBar.
* 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
int menu_is_menubar(char_u *name)
{ {
return !menu_is_popup(name) return !menu_is_popup(name)
&& !menu_is_toolbar(name) && !menu_is_toolbar(name)
&& !menu_is_winbar(name)
&& *name != MNU_HIDDEN_CHAR; && *name != MNU_HIDDEN_CHAR;
} }
/* // Return true if "name" is a popup menu 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
int menu_is_popup(char_u *name)
{ {
return STRNCMP(name, "PopUp", 5) == 0; return STRNCMP(name, "PopUp", 5) == 0;
} }
/* // Return true if "name" is a toolbar menu 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
int menu_is_toolbar(char_u *name)
{ {
return STRNCMP(name, "ToolBar", 7) == 0; return STRNCMP(name, "ToolBar", 7) == 0;
} }