summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2015-06-09 19:14:24 +0200
committerBram Moolenaar <Bram@vim.org>2015-06-09 19:14:24 +0200
commit7098ee5c37e35494ed36f3ad2d1c305341a41a45 (patch)
treedbe2fa1707f573493798d74dbe03020306fbf4da
parentbc56336bb4501884257352446abb60713cef6452 (diff)
downloadvim-7098ee5c37e35494ed36f3ad2d1c305341a41a45.zip
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)
-rw-r--r--src/gui_gtk_x11.c4
-rw-r--r--src/gui_mac.c3
-rw-r--r--src/gui_motif.c19
-rw-r--r--src/gui_w48.c4
-rw-r--r--src/version.c2
5 files changed, 21 insertions, 11 deletions
diff --git a/src/gui_gtk_x11.c b/src/gui_gtk_x11.c
index 97ad6b068..553844605 100644
--- a/src/gui_gtk_x11.c
+++ b/src/gui_gtk_x11.c
@@ -2873,7 +2873,9 @@ create_tabline_menu(void)
GtkWidget *menu;
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 *)_("Open Tab..."), TABLINE_MENU_OPEN);
diff --git a/src/gui_mac.c b/src/gui_mac.c
index 54087c518..3479dbb55 100644
--- a/src/gui_mac.c
+++ b/src/gui_mac.c
@@ -6819,7 +6819,8 @@ initialise_tabline(void)
// create tabline popup menu required by vim docs (see :he tabline-menu)
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);
AppendMenuItemTextWithCFString(contextMenu, CFSTR("New Tab"), 0,
TABLINE_MENU_NEW, NULL);
diff --git a/src/gui_motif.c b/src/gui_motif.c
index 57f264df9..eb8c3255b 100644
--- a/src/gui_motif.c
+++ b/src/gui_motif.c
@@ -540,14 +540,17 @@ gui_x11_create_widgets()
tabLine_menu = XmCreatePopupMenu(tabLine, "tabline popup", NULL, 0);
/* Add the buttons to the menu */
- n = 0;
- XtSetArg(args[n], XmNuserData, TABLINE_MENU_CLOSE); n++;
- xms = XmStringCreate((char *)"Close tab", STRING_TAG);
- XtSetArg(args[n], XmNlabelString, xms); n++;
- button = XmCreatePushButton(tabLine_menu, "Close", args, n);
- XtAddCallback(button, XmNactivateCallback,
- (XtCallbackProc)tabline_button_cb, NULL);
- XmStringFree(xms);
+ if (first_tabpage->tp_next != NULL)
+ {
+ n = 0;
+ XtSetArg(args[n], XmNuserData, TABLINE_MENU_CLOSE); n++;
+ xms = XmStringCreate((char *)"Close tab", STRING_TAG);
+ XtSetArg(args[n], XmNlabelString, xms); n++;
+ button = XmCreatePushButton(tabLine_menu, "Close", args, n);
+ XtAddCallback(button, XmNactivateCallback,
+ (XtCallbackProc)tabline_button_cb, NULL);
+ XmStringFree(xms);
+ }
n = 0;
XtSetArg(args[n], XmNuserData, TABLINE_MENU_NEW); n++;
diff --git a/src/gui_w48.c b/src/gui_w48.c
index cd7fdde54..1096ec845 100644
--- a/src/gui_w48.c
+++ b/src/gui_w48.c
@@ -2389,7 +2389,9 @@ show_tabline_popup_menu(void)
if (tab_pmenu == NULL)
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_OPEN,
_("Open tab..."));
diff --git a/src/version.c b/src/version.c
index 6b8b15e8e..680e551fb 100644
--- a/src/version.c
+++ b/src/version.c
@@ -742,6 +742,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 731,
+/**/
730,
/**/
729,