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 Scrolling in tmux #226

Closed
agarrharr opened this issue Jan 20, 2015 · 5 comments
Closed

Mouse Scrolling in tmux #226

agarrharr opened this issue Jan 20, 2015 · 5 comments

Comments

@agarrharr
Copy link

When I have this plugin installed it causing mouse scrolling issues in tmux. Normally I can scroll around inside of vim files inside of tmux just fine, but when this plugin is installed, I can only scroll down the file. When I try scrolling up the file, it scrolls up in tmux instead.

It doesn't happen in every file, so I'm not sure what's causing this.

I'm using mac os x, vim version 7.4, and iTerm 2.

@airblade
Copy link
Owner

I can't think of a reason for this behaviour off the top of my head. I'm away at the moment so can't investigate until next week.

Do you have the same problem using Terminal.app instead of iTerm 2?

Are you able to find something in common with the files where this occurs? E.g. are they (not) tracked by git?

Is your vimrc online anywhere?

@agarrharr
Copy link
Author

So, originally I thought it was from the tagbar plugin. Removing it, seemed to fix most of my problems (preservim/tagbar#243 (comment)), but I noticed it the other day with a particular file.

I don't have the same issue in Terminal because it doesn't do mouse scrolling as well. In Terminal I can't scroll tmux with the mouse. And when I scroll in vim in Terminal, it doesn't scroll the page really, it just moves the cursor up and down until that causes vim to scroll.

Yes, it always seems to happen for files that aren't tracked by git. It doesn't happen for unsaved files or unsaved buffers, but as soon as I save the file, if it's not tracked by git, it has this issue.

My vimrc is here: https://github.com/aharris88/dotfiles/blob/master/vim/vimrc

@airblade
Copy link
Owner

I still can't think of any reason for vim-gitgutter to cause this problem. The plugin doesn't do anything with the mouse or scrolling or terminal escape sequences. And it's especially odd that scrolling in one direction works but not the other.

The only thing that stood out in your vimrc was your setting the updatetime to 10ms. This will fire vim-gitgutter's CursorHold and CursorHoldI autocommands every 10ms. That should be fine but perhaps you could try setting the value to 100 or 500 and see if that makes any difference.

@agarrharr
Copy link
Author

It seems to make sense that it only happens in one direction because if I'm scrolling towards the bottom of a file, tmux has nowhere to scroll, but if I'm scrolling towards the top of a file, tmux can scroll up above vim.

If that makes any sense.

You're totally right! I switched

set updatetime=10

to

set updatetime=100

and it works great! Thanks for all your work, I love this plugin, and your course on PluralSight!

@airblade
Copy link
Owner

That's great to hear, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants