To: vim_dev@googlegroups.com Subject: Patch 9.0.0597 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 9.0.0597 Problem: Cannot close a tab page with the middle mouse button. Solution: Support closing a tab page with the middle mouse button, like many other programs. (closes #10746) Files: src/gui_gtk_x11.c, src/gui_w32.c *** ../vim-9.0.0596/src/gui_gtk_x11.c 2022-09-17 21:07:52.095993168 +0100 --- src/gui_gtk_x11.c 2022-09-26 20:36:14.890122328 +0100 *************** *** 3345,3350 **** --- 3345,3356 ---- send_tabline_event(x < 50 ? -1 : 0); } } + else if (bevent->button == 2) + { + if (clicked_page != 0) + // Middle mouse click on tabpage label closes that tab. + send_tabline_menu_event(clicked_page, TABLINE_MENU_CLOSE); + } } // We didn't handle the event. *** ../vim-9.0.0596/src/gui_w32.c 2022-09-10 13:03:08.959148178 +0100 --- src/gui_w32.c 2022-09-26 20:40:38.854129533 +0100 *************** *** 8094,8099 **** --- 8094,8113 ---- } break; } + case WM_MBUTTONUP: + { + TCHITTESTINFO htinfo; + + htinfo.pt.x = GET_X_LPARAM(lParam); + htinfo.pt.y = GET_Y_LPARAM(lParam); + idx0 = TabCtrl_HitTest(hwnd, &htinfo); + if (idx0 != -1) + { + idx0 += 1; + send_tabline_menu_event(idx0, TABLINE_MENU_CLOSE); + } + break; + } default: break; } *** ../vim-9.0.0596/src/version.c 2022-09-26 20:17:22.388415107 +0100 --- src/version.c 2022-09-26 20:48:12.323431439 +0100 *************** *** 701,702 **** --- 701,704 ---- { /* Add new patch number below this line */ + /**/ + 597, /**/ -- hundred-and-one symptoms of being an internet addict: 184. You no longer ask prospective dates what their sign is, instead your line is "Hi, what's your URL?" /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///