1
0
forked from aniani/vim

patch 8.1.0577: tabpage right-click menu never shows "Close tab"

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.
This commit is contained in:
Bram Moolenaar
2018-12-11 20:39:19 +01:00
parent 30700cd5ff
commit 295471920d
5 changed files with 19 additions and 19 deletions

View File

@@ -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++;