psliwka / vim-smoothie

Smooth scrolling for Vim done right🥤
MIT License
994 stars 27 forks source link

Codebase refactoring issues #36

Open ds2606 opened 2 years ago

ds2606 commented 2 years ago

Re-mentioning issues mentioned in #35 after it was closed as it might've been missed

Unfortunately, the scrolling behavior seems to be much choppier on https://github.com/psliwka/vim-smoothie/commit/fc7f0b3bc2c6c57fb39311c1a48d10eea099145a than the last good commit I've identified, which for now is 10fd0aa. I'm not sure why this is (I have two terminal windows open side by side, one with vim running at each commit to compare) but some wires seem to have maybe been crossed up in the refactor 🫤 I think for now I'll just leave HEAD at 10fd0aa.

There seem to be other issues that cropped up with the codebase refactoring; one of them is: quick page-downs in succession don't work (e.g. spamming ) as smoothie fails to recognize the successive keypresses, whereas in fc7f0b3 I could quickly hit a bunch of times and vim-smoothie would react to each event (not missing any keypresses).

timtyrrell commented 2 years ago

Yup, lots of flicking now but going back to the commit mentioned above resolves it.

psliwka commented 2 years ago

Thanks for reporting this! The refactoring indeed caused the plugin to redraw the screen more aggressively, which could cause tearing on slow terminals (I failed to notice this, because on Kitty there is no tearing at all). I've just pushed a fix for this in c0bfa9df5808ea99c7a0e5170d6f7e8e92927c9f – testing on iTerm, looks as smooth as the old version to me. Please let me know how it looks like on your side now @ds2606 & @timtyrrell.

quick page-downs in succession don't work (e.g. spamming ) as smoothie fails to recognize the successive keypresses

I couldn't reproduce this, @ds2606 – scrolling seems OK to me, even if I spam or hold down a key. Could you please provide more details on this? What Vim version and terminal emulator are you on?

ds2606 commented 2 years ago

Thanks for your work on this @psliwka. It does seem that the repetitive-key failure is fixed on this commit.

Unfortunately, it seems that there are a lot of flickering artifacts introduced by the redrawing. To show you, I've recorded a short screencast of using vim-smoothie on a 1000-line stylesheet. On the left side is vim running with smoothie at c0bfa9d (the newest push), and the right side is vim running at 10fd0aa (the commit before codebase refactoring). For each pane, I repeatedly scroll down five times quickly and up 5 times quickly.

Screencast

Hopefully it is visible that the right pane has visually cleaner scrolling without flickering redrawing artifacts. It's not a huge difference, but enough for me not to see a reason to continue to leave my repo at 10fd0aa.

(System details: Vim 8.2, MacOS 12.3, iTerm 3.4.15)

ranebrown commented 2 years ago

I'm seeing the same issue including with inccommand that does not occur with the older commit.

pfernandez commented 2 years ago

I'm still seeing flickering in iTerm too, and Smoothie now also does nothing when the cursor begins at the very top or bottom of a file. I suspect that I'm seeing this because I have my cursor set to remain vertically centered with set scrolloff=999.

At first I thought these must have been due to the refactor in 10fd0aa, but after trying several commits I identified the culprit as c0bfa9d, "Improve smoothness on slow terminals". I also noticed that the flickering only seems to happen when scrolling up, not down. I've pinned my version to the previous commit, b440f13 for now.

The second issue appears in 4206594, "Add workaround to prevent animation sticking".

Glad to see this project getting some attention! ❤️ I hope the above is helpful.