[vim/vim] feature: support tab closing by middle button clicking on Windows (PR #10746)

14 views
Skip to first unread message

regomne

unread,
Jul 16, 2022, 11:58:05 PM7/16/22
to vim/vim, Subscribed

You can view, comment on, or merge this pull request online at:

  https://github.com/vim/vim/pull/10746

Commit Summary

  • 9a6bf4b feature: support tab closing by middle button clicking

File Changes

(1 file)

Patch Links:


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/10746@github.com>

Bram Moolenaar

unread,
Jul 26, 2022, 10:49:05 AM7/26/22
to vim/vim, Subscribed

Doesn't this make it too easy to close a tab?
Is using the middle mouse button a common way in MS-Windows to close a Tab?
Most mice don't even have a middle mouse button.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/10746/c1195582339@github.com>

K.Takata

unread,
Jul 26, 2022, 8:54:06 PM7/26/22
to vim/vim, Subscribed

Recent mice have a wheel and clicking it has the same effect.
Browsers like Chrome and Firefox support closing a tab by clicking a middle button, but it can be easily undone (e.g. Ctrl+Shift+T).
I'm not sure whether we should support it on Vim.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/10746/c1196150444@github.com>

K.Takata

unread,
Jul 26, 2022, 9:04:33 PM7/26/22
to vim/vim, Subscribed

Doesn't this make it too easy to close a tab?

Ah, maybe #10747 is a measure for this.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/10746/c1196155843@github.com>

regomne

unread,
Jul 26, 2022, 9:36:34 PM7/26/22
to vim/vim, Subscribed

The reason I put this pr is that most text editors in Windows that support tabs support closing a tab with the middle mouse button, such as VS Code, Sublime text, notepad++, Ultra Edit, Visual Studio.

Browsers like Chrome and Firefox support closing a tab by clicking a middle button, but it can be easily undone (e.g. Ctrl+Shift+T).

Browsers just reopen a closed tab instead of undone, as the behavior of interacting through js scripts in the page can be hardly undone correctly.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/10746/c1196170704@github.com>

Bram Moolenaar

unread,
Jul 27, 2022, 7:31:33 AM7/27/22
to vim/vim, Subscribed


> The reason I put this pr is that most text editors in Windows that
> support tabs support closing a tab with the middle mouse button, such
> as VS Code, Sublime text, notepad++, Ultra Edit, Visual Studio.
>
> > Browsers like Chrome and Firefox support closing a tab by clicking a
> > middle button, but it can be easily undone (e.g. Ctrl+Shift+T).
>
> Browsers just reopen a closed tab instead of undone, as the behavior
> of interacting through js scripts in the page can be hardly undone
> correctly.

OK, so there are other applications where one can close a tab with a
middle mouse click. I just checked Chrome on Linux and that appears to
support it too.

Only doing this on MS-Windows GUI is rather limited. Should at least do
it in all GUI versions. Perhaps we don't need it in a terminal (which
shows a text line for the tabs).

--
hundred-and-one symptoms of being an internet addict:
147. You finally give up smoking...because it made the monitor dirty.

/// Bram Moolenaar -- ***@***.*** -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/10746/c1196609097@github.com>

regomne

unread,
Jul 29, 2022, 8:19:48 AM7/29/22
to vim/vim, Subscribed

@brammool OK,I will try to add support for other platforms.


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/10746/c1199211452@github.com>

regomne

unread,
Sep 3, 2022, 4:50:49 AM9/3/22
to vim/vim, Push

@regomne pushed 1 commit.

  • 300ec34 Merge branch 'vim:master' into master


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/10746/push/10915273498@github.com>

codecov[bot]

unread,
Sep 8, 2022, 5:30:45 AM9/8/22
to vim/vim, Subscribed

Codecov Report

Merging #10746 (300ec34) into master (b18b496) will decrease coverage by 82.17%.
The diff coverage is n/a.

@@             Coverage Diff             @@

##           master   #10746       +/-   ##

===========================================

- Coverage   82.47%    0.29%   -82.18%     

===========================================

  Files         152      152               

  Lines      177672   173427     -4245     

  Branches    40331    39908      -423     

===========================================

- Hits       146528      520   -146008     

- Misses      18948   172850   +153902     

+ Partials    12196       57    -12139     
Flag Coverage Δ
huge-clang-none ?
huge-gcc-none ?
huge-gcc-testgui ?
huge-gcc-unittests 0.29% <ø> (ø)
linux 0.29% <ø> (-82.18%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/float.c 0.00% <0.00%> (-98.44%) ⬇️
src/sha256.c 0.00% <0.00%> (-94.90%) ⬇️
src/gui_gtk_f.c 0.00% <0.00%> (-94.72%) ⬇️
src/arabic.c 0.00% <0.00%> (-94.57%) ⬇️
src/crypt_zip.c 0.00% <0.00%> (-94.12%) ⬇️
src/typval.c 0.00% <0.00%> (-92.47%) ⬇️
src/debugger.c 0.00% <0.00%> (-92.23%) ⬇️
src/blob.c 0.00% <0.00%> (-92.18%) ⬇️
src/vim9compile.c 0.00% <0.00%> (-91.85%) ⬇️
src/ex_docmd.c 0.00% <0.00%> (-91.81%) ⬇️
... and 136 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/10746/c1240465178@github.com>

regomne

unread,
Sep 25, 2022, 7:58:14 PM9/25/22
to vim/vim, Push

@regomne pushed 1 commit.

  • a4e9671 Merge branch 'vim:master' into master

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/10746/push/11131522117@github.com>

regomne

unread,
Sep 25, 2022, 8:03:23 PM9/25/22
to vim/vim, Push

@regomne pushed 1 commit.

  • d367769 add support for gtk and motif

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/10746/push/11131542469@github.com>

Bram Moolenaar

unread,
Sep 26, 2022, 3:46:52 PM9/26/22
to vim/vim, Subscribed

I tried this with Motif, but it looks like the "paste" functionality overrides it. When I press the middle mouse button some icon appears.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/10746/c1258535660@github.com>

Bram Moolenaar

unread,
Sep 26, 2022, 3:49:22 PM9/26/22
to vim/vim, Subscribed

Closed #10746 via 3bdef10.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/10746/issue_event/7461990536@github.com>

regomne

unread,
Sep 26, 2022, 7:31:06 PM9/26/22
to vim/vim, Subscribed

I tried this with Motif, but it looks like the "paste" functionality overrides it. When I press the middle mouse button some icon appears.

It seems that the default behavior of middle button pressing in motif window is Drag&drop. I tried to turn off it according to the chapter "Turning Off Drag and Drop Functionality", but failed. Could you provide some help?


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/10746/c1258764134@github.com>

Bram Moolenaar

unread,
Sep 27, 2022, 6:29:11 AM9/27/22
to vim/vim, Subscribed


> > I tried this with Motif, but it looks like the "paste" functionality
> > overrides it. When I press the middle mouse button some icon
> > appears.
>
> It seems that the default behavior of middle button pressing in motif
> window is
> [Drag&drop](http://www.ist.co.uk/motif/books/vol6A/ch-22.fm.html). I

> tried to turn off it according to the chapter "Turning Off Drag and
> Drop Functionality", but failed. Could you provide some help?

Not me. I hope someone familiar with Motif and X11 can help out.

--
A computer program does what you tell it to do, not what you want it to do.


/// Bram Moolenaar -- ***@***.*** -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/10746/c1259303478@github.com>

Reply all
Reply to author
Forward
0 new messages