joeytwiddle / sexy_scroller.vim

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

Disable during incsearch. #11

Open jordwalke opened 8 years ago

jordwalke commented 8 years ago

This is a wonderful plugin, but unfortunately it cannot be used with incsearch as it is too distracting. It's not that it doesn't work with incsearch - rather, it causes buggy movement when incsearch is enabled. When typing /something, incsearch finds the correct location as you type, but then when you hit enter, the animation occurs from the previous location instead of the screen remaining where incsearch brought you to.

joeytwiddle commented 8 years ago

I am aware of this issue (although I have become accustomed to the weird behaviour).

CursorMoved events do not fire while performing an incremental search, so the plugin is not aware that the cursor has moved until after the searching is over, and so the animation only happens after leaving the search.

Possible solutions would be to:

  1. remap / and ? to temporarily disable smooth scrolling,
  2. or replace them with a scripted searching mechanism that could perform smooth scrolling while doing incremental search.

I guess I should do 1 to at least hide the bug. 2 would be a bit heavy for this "lightweight" script.