Skip to content
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

Mouse support in Vim 8.0 or earlier #6

Open
adelarsq opened this issue Feb 2, 2015 · 3 comments
Open

Mouse support in Vim 8.0 or earlier #6

adelarsq opened this issue Feb 2, 2015 · 3 comments

Comments

@adelarsq
Copy link

adelarsq commented Feb 2, 2015

When doing a double click to change between buffers the tabline looks like:
image
Would be nice support mouse click.

@ap
Copy link
Owner

ap commented Feb 2, 2015

Yes, it would be nice. But it’s very difficult to make it work without glitches. And turning on this feature would make it impossible to use regular Vim tabs at all. If you’re interested, you can try picking up the krazy branch and finishing what I started, and I shall be happy to look at the results. But I do not intend to put further work into it myself, sorry.

@ap ap closed this as completed Feb 2, 2015
@adelarsq
Copy link
Author

adelarsq commented Feb 2, 2015

It's more difficult than I thought vim-airline/vim-airline#369
Anyway, thanks for the quick response.

@ap
Copy link
Owner

ap commented Feb 2, 2015

I don’t know that it’s impossible; it could be that sufficiently clever hackery can make it work, as long as you are willing to give up Vim tabs completely forever.

Then the basic approach is to have as many extra Vim tabs as you have buffers. You can then intercept the tab change events caused by the user clicking on the tabline, and switch buffers accordingly.

The problem is making sure that the buffer and window management works exactly like it would if you only had a single Vim tab. E.g. keeping Vim from creating or not-closing empty buffers in various circumstances.

I got most of the way there with several different approaches, each with another combination of tricks to create the right illusion, but each approach had its own cases in which the illusion broke. I didn’t manage to make any of them work perfectly. In the end I gave up.

Someday in the future I may try again, and one of these attempts may even succeed.

@ap ap reopened this Aug 30, 2016
@ap ap changed the title Mouse support Mouse support in Vim 8.0 or earlier Jul 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants