joeytwiddle / sexy_scroller.vim

smooth animation of the cursor and the page whenever they move, with easing
89 stars 7 forks source link

Lag with closed folds #3

Open omidmnz opened 11 years ago

omidmnz commented 11 years ago

You get a lag when the cursor reaches a closed fold. To reproduce, open http://pastebin.com/i0rZncqx in vim, then execute ":set foldmethod=indent", press "zM" in normal mode, and "ggG", or "Ggg". You should see the lag when cursor reaches any of the closed folds.

joeytwiddle commented 10 years ago

Yes, it's scrolling smoothly through all of the invisible lines! ;-)

It might be possible to fix this, but a little fiddly. We would need to calculate in advance which lines are folded or not. We need to ease over the visible lines, not the actual buffer lines that sexy_scroller uses at the moment.

I note that SmoothCenter.vim uses some magic for this, but it will only work for the lines currently in view:

let hiddenlines = line("w$")-line("w0")-winheight(0)