mirror of
https://github.com/vim/vim.git
synced 2025-09-29 04:34:16 -04:00
patch 7.4.731
Problem: The tab menu shows "Close tab" even when it doesn't work. Solution: Don't show "Close tab" for the last tab. (John Marriott)
This commit is contained in:
@@ -2873,7 +2873,9 @@ create_tabline_menu(void)
|
|||||||
GtkWidget *menu;
|
GtkWidget *menu;
|
||||||
|
|
||||||
menu = gtk_menu_new();
|
menu = gtk_menu_new();
|
||||||
add_tabline_menu_item(menu, (char_u *)_("Close"), TABLINE_MENU_CLOSE);
|
if (first_tabpage->tp_next != NULL)
|
||||||
|
add_tabline_menu_item(menu, (char_u *)_("Close tab"),
|
||||||
|
TABLINE_MENU_CLOSE);
|
||||||
add_tabline_menu_item(menu, (char_u *)_("New tab"), TABLINE_MENU_NEW);
|
add_tabline_menu_item(menu, (char_u *)_("New tab"), TABLINE_MENU_NEW);
|
||||||
add_tabline_menu_item(menu, (char_u *)_("Open Tab..."), TABLINE_MENU_OPEN);
|
add_tabline_menu_item(menu, (char_u *)_("Open Tab..."), TABLINE_MENU_OPEN);
|
||||||
|
|
||||||
|
@@ -6819,7 +6819,8 @@ initialise_tabline(void)
|
|||||||
|
|
||||||
// create tabline popup menu required by vim docs (see :he tabline-menu)
|
// create tabline popup menu required by vim docs (see :he tabline-menu)
|
||||||
CreateNewMenu(kTabContextMenuId, 0, &contextMenu);
|
CreateNewMenu(kTabContextMenuId, 0, &contextMenu);
|
||||||
AppendMenuItemTextWithCFString(contextMenu, CFSTR("Close"), 0,
|
if (first_tabpage->tp_next != NULL)
|
||||||
|
AppendMenuItemTextWithCFString(contextMenu, CFSTR("Close Tab"), 0,
|
||||||
TABLINE_MENU_CLOSE, NULL);
|
TABLINE_MENU_CLOSE, NULL);
|
||||||
AppendMenuItemTextWithCFString(contextMenu, CFSTR("New Tab"), 0,
|
AppendMenuItemTextWithCFString(contextMenu, CFSTR("New Tab"), 0,
|
||||||
TABLINE_MENU_NEW, NULL);
|
TABLINE_MENU_NEW, NULL);
|
||||||
|
@@ -540,14 +540,17 @@ gui_x11_create_widgets()
|
|||||||
tabLine_menu = XmCreatePopupMenu(tabLine, "tabline popup", NULL, 0);
|
tabLine_menu = XmCreatePopupMenu(tabLine, "tabline popup", NULL, 0);
|
||||||
|
|
||||||
/* Add the buttons to the menu */
|
/* Add the buttons to the menu */
|
||||||
n = 0;
|
if (first_tabpage->tp_next != NULL)
|
||||||
XtSetArg(args[n], XmNuserData, TABLINE_MENU_CLOSE); n++;
|
{
|
||||||
xms = XmStringCreate((char *)"Close tab", STRING_TAG);
|
n = 0;
|
||||||
XtSetArg(args[n], XmNlabelString, xms); n++;
|
XtSetArg(args[n], XmNuserData, TABLINE_MENU_CLOSE); n++;
|
||||||
button = XmCreatePushButton(tabLine_menu, "Close", args, n);
|
xms = XmStringCreate((char *)"Close tab", STRING_TAG);
|
||||||
XtAddCallback(button, XmNactivateCallback,
|
XtSetArg(args[n], XmNlabelString, xms); n++;
|
||||||
(XtCallbackProc)tabline_button_cb, NULL);
|
button = XmCreatePushButton(tabLine_menu, "Close", args, n);
|
||||||
XmStringFree(xms);
|
XtAddCallback(button, XmNactivateCallback,
|
||||||
|
(XtCallbackProc)tabline_button_cb, NULL);
|
||||||
|
XmStringFree(xms);
|
||||||
|
}
|
||||||
|
|
||||||
n = 0;
|
n = 0;
|
||||||
XtSetArg(args[n], XmNuserData, TABLINE_MENU_NEW); n++;
|
XtSetArg(args[n], XmNuserData, TABLINE_MENU_NEW); n++;
|
||||||
|
@@ -2389,7 +2389,9 @@ show_tabline_popup_menu(void)
|
|||||||
if (tab_pmenu == NULL)
|
if (tab_pmenu == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
add_tabline_popup_menu_entry(tab_pmenu, TABLINE_MENU_CLOSE, _("Close tab"));
|
if (first_tabpage->tp_next != NULL)
|
||||||
|
add_tabline_popup_menu_entry(tab_pmenu,
|
||||||
|
TABLINE_MENU_CLOSE, _("Close tab"));
|
||||||
add_tabline_popup_menu_entry(tab_pmenu, TABLINE_MENU_NEW, _("New tab"));
|
add_tabline_popup_menu_entry(tab_pmenu, TABLINE_MENU_NEW, _("New tab"));
|
||||||
add_tabline_popup_menu_entry(tab_pmenu, TABLINE_MENU_OPEN,
|
add_tabline_popup_menu_entry(tab_pmenu, TABLINE_MENU_OPEN,
|
||||||
_("Open tab..."));
|
_("Open tab..."));
|
||||||
|
@@ -741,6 +741,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
731,
|
||||||
/**/
|
/**/
|
||||||
730,
|
730,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user