caksoylar/kakoune-smooth-scroll

Plugin does not work correctly with max scrolloff set

Opened this issue · 2 comments

I've been using a high scrolloff setting pretty much since I began using vim and have done the same thing in kakoune with set-option global scrolloff 99,3 # Center cursor and it works great for my needs so I always know where my main cursor/selection is. I had never heard of these smooth scroll plugins for vim and thought the idea was cool when I came across this one but, unfortunately, it doesn't seem to work in this "auto-center" mode that I use, if you want to call it that.

I disabled that one line after the plugin didn't work when I installed it and then it worked fine and now it has stopped working when I uncommented the scrolloff line again.

Are you using Kakoune on your local computer or through a remote interface (SSH, RDP etc)?

I am using it locally.

Is scrolling smooth otherwise and only hangs up like this occasionally, or is there general choppiness?

It works perfectly fine without the scrolloff setting enabled.

Are you using the latest master?

I have installed it with plug.kak
plug "caksoylar/kakoune-smooth-scroll"
I'm just manually enabling it with smooth-scroll-enable so I don't have the WinCreate hook in the config section right now.

Do you see any errors or warning messages in the debug buffer?

There are no errors when loading it and just some highlighting false positives if I manually source it.

Thanks for the detailed report. I have done some testing with large scrolloff values and indeed it either scroll smoothly or moves to the wrong line (depending on whether page-based movements like <c-u> or others are used, since they work with slightly different mechanisms).

The fundamental issue seems to be that depending on the window height and cursor position, vj and j, or vk and k doesn't always scroll a single line in this large scrolloff mode. In some cases it doesn't move at all, in some cases it moves by two lines. Since we have to use vjj and vkk to smoothly scroll down and up respectively, I can't see a way out of this right now.

Sorry about that, you obviously spent time testing it. For now, I'll add a note to the README noting that it won't work with large scrolloff values.

Alright thanks for your quick resposne. Thankfully it's not a deal-breaker for me as high scrolloff values help me know where I am in a document anyway but glad you can add it as a caveat.