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

Disable scroller for mouse scrolling? #8

Open
ThomsonTan opened this issue Dec 11, 2014 · 2 comments
Open

Disable scroller for mouse scrolling? #8

ThomsonTan opened this issue Dec 11, 2014 · 2 comments
Labels

Comments

@ThomsonTan
Copy link
Contributor

Even if I saw there is no way to fix this currently in the ReadMe, I still try to raise it here to seek any possibility to mitigate this. As using mouse occasionally, the repeated scrolling is very annoy.

@joeytwiddle
Copy link
Owner

joeytwiddle commented Dec 29, 2014

Hi Thomson, yes it bothers me too, occasionally. But I don't know of any way to detect that the scroll is caused by the mouse or mouse wheel.

If you pull the latest version, I have exposed the minimum thresholds before SexyScroller will act.

You could try increasing them until mouse scrolling is no longer affected. But the value you need may depend on how fast you scroll your mouse, and how slowly your Vim is running!

" When scrolling pushes the cursor onto an empty line,
" the column could change a lot.
" This should eliminate that issue:

:let g:SexyScroller_MinColumns = 999

" OK let's tweak the more interesting value...

:let g:SexyScroller_MinLines = 2      " the old default
:let g:SexyScroller_MinLines = 3      " the new default

:let g:SexyScroller_MinLines = 5      " surely this should help

:let g:SexyScroller_MinLines = 15     " if this doesn't help, you must be scrolling fast!

:let g:SexyScroller_MinLines = 50     " you will only get smooth scroll for large jumps now

I would be interested to hear what value mitigates the issue for you. I will also be experimenting in my Vims. On this machine, 3 seems to help a lot. Cheers!

@joeytwiddle
Copy link
Owner

joeytwiddle commented Apr 19, 2016

Testing now on Mac OS X,

:let g:SexyScroller_MinLines = 20

helps a bit, but SS still causes some lag in certain situations (noted below).

:let g:SexyScroller_MinLines = 70

helps a lot more! Setting that means SS will only provide animation for large jumps, but it seems like a worthwhile tradeoff. (70 is a value near to :echo &lines.)

It seems that the problem specifically occurs when mouse wheel scrolling causes the cursor to hit the top/bottom of the window, which forces the cursor to start moving.


Could we solve it? Here is half of an idea:

It is possible to detect mouse scroll events with:

:nnoremap <ScrollWheelDown> :let g:SexyScrollerTempDisable = reltime()<CR>

but unfortunately that captures the mouse scroll event, so Vim doesn't move at all! If we could replay it, then this might be a way to disable SS during mouse scrolling. But so far I have not had any luck trying :call feedkeys("\<ScrollWheelDown>")<CR>.

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

No branches or pull requests

2 participants