New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[RDY] Fix visual selection after left click on tabline #2383
Conversation
21f53a8
to
dead852
Compare
LGTM, only need to add a functional test(which should be easy, have a look at some tests in mouse_spec.lua) |
LGTM, though I'm not fully familiar with |
Added an UI test. I'll investigate why the same bug doesn't happen with Vim. |
8cc9a00
to
254950d
Compare
So.. now there are 2 new tests. The first just checks if left clicking on a tab in the tabline switches to that tabpage. The second checks if visual selection is still working after a tab in the tabline was left clicked.. and currently that test fails, even after the one-line fix. Instead it switches the places of the tabs which is the actual bug. It works if I try it manually though.. I'll dig deeper. |
@mhinz a little tip: You can attach a pynvim GUI to one of the tests with a |
So I ran into this bug and i'm pretty happy that there is a fix. Any chance the PR can get merged? Maybe the PR just needs a little merging to get the CI to pass |
The fix (mhinz@a1543e2) is working, but the tests don't act as if a user would click around manually. The test itself should be also correct, but something else has to changed yet. Any pointers are welcome. |
@mhinz Might the test need a |
@splinterofchaos Uhm.. thank you! |
Woo! i would love to see this fixed in neovim |
Looks like the tests are still failing for the same reason. I'm not familiar with the mouse handling code, nor |
Hmm, inserting the Actually it fails because for another reason now.. before the |
d712ce0
to
cb9098a
Compare
68b683f
to
540a70c
Compare
a5e9495
to
5be80b9
Compare
Should be working now. |
LGTM 👍 |
Can this be merged? |
After left clicking on a tab in the tabline, the "in_tab_line" variable wasn't set to 'false' and every following mouse action assumed still being on the tabline which messed up visual selection etc.
Fix visual selection after left click on tabline
I have the same issue with NVIM v0.2.2 |
@thor85 Can you reproduce it with |
Yea have the same problem then. If I hold down and move the mouse I'm just moving the tabs around. |
Okay, that's expected behaviour. But afterwards you can't click anything in the tabline anymore, right? |
No I mean if I click and hold to select some text, it will not select text, but move the tab around. So when I first open nvim I can select text fine with the mouse. If I change tab with :tabn I can still select text. If I change tab with a mouse click, I cannot select text anymore. Clicking the mouse anywhere just seems like it clicks the tab bar. Have not found any way to reset it except exiting nvim and start over again. |
Do you use an actual mouse or an trackpad? Do you use tmux? I tested around a bit and I can reproduce a similar issue when "tapping" a tab in the tabline and then trying to select something. When I use a "full left-click" by pressing the trackpad all the way to the buttom (until it clicks), everything works as expected. We currently believe that it's a bug in the terminal/tmux, because trackpad tapping and clicking should be handled exactly the same, but it feels as if with tapping there's no proper release. Then Nvim thinks you're still dragging in the tabline. I can reproduce it with Terminal.app and tmux, but not without tmux. I can't reproduce it with iTerm2 at all. |
I use an actual mouse. I do use tmux, but I tried without tmux now and got the same problem. I usually use urxvt, but tried gnome terminal and got the same. However, this is not running directly on my pc. I use a windows laptop to connect with HP RGS to the linux server and run from there, so maybe that could be why the mouse acts weird. I don't have a linux pc available to test right now. |
@thor85 I'm not sure how to help you right now. I think it would be best if you'd open a new issue and describe the issue again with as many details about your environment as possible. |
After left clicking on a tab in the tabline, the
in_tab_line
variable wasn'tset to
false
and every following mouse action assumed still being on thetabline which messed up visual selection etc.
References #2382.