summaryrefslogtreecommitdiff
path: root/src/gui_motif.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2018-12-11 20:39:19 +0100
committerBram Moolenaar <Bram@vim.org>2018-12-11 20:39:19 +0100
commit295471920def98ce84bc96e5d97c16d250c81621 (patch)
tree7490f90afb9d639216c80a4942629a19510654ab /src/gui_motif.c
parent30700cd5ffa258f1d684ab6b34bd03e970450dba (diff)
downloadvim-git-295471920def98ce84bc96e5d97c16d250c81621.tar.gz
patch 8.1.0577: tabpage right-click menu never shows "Close tab"v8.1.0577
Problem: Tabpage right-click menu never shows "Close tab". Solution: Always create the "Close tab" item but ignore the event if there is only one tab.
Diffstat (limited to 'src/gui_motif.c')
-rw-r--r--src/gui_motif.c23
1 files changed, 10 insertions, 13 deletions
diff --git a/src/gui_motif.c b/src/gui_motif.c
index 8467c529d..b6c140be3 100644
--- a/src/gui_motif.c
+++ b/src/gui_motif.c
@@ -514,21 +514,18 @@ gui_x11_create_widgets(void)
XtVaSetValues(scroller, XmNwidth, 0, XmNresizable, False,
XmNtraversalOn, False, NULL);
- /* Create the tabline popup menu */
+ // Create the tabline popup menu
tabLine_menu = XmCreatePopupMenu(tabLine, "tabline popup", NULL, 0);
- /* Add the buttons to the menu */
- 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);
- }
+ // Add the buttons to the tabline popup 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);
n = 0;
XtSetArg(args[n], XmNuserData, TABLINE_MENU_NEW); n++;