karb94 / neoscroll.nvim

Smooth scrolling neovim plugin written in lua
MIT License
1.46k stars 36 forks source link

works not very with wrapped lines. #82

Closed cathaysia closed 9 months ago

cathaysia commented 1 year ago

It seems #13 fixed this problem. But it not works very well:

https://user-images.githubusercontent.com/42114817/226256694-ab659534-3565-4dc4-aece-1ea10854334b.mp4

As you see. When I press ctrl-d, then line numer become 43. But expected 21. :(

cathaysia commented 1 year ago

here is that file: shared-libraries.adoc.txt

copy from https://tldp.org/HOWTO/Program-Library-HOWTO/shared-libraries.html

set scrolloff=1 can solve this problem, but that doesn't look smooth at all.

karb94 commented 9 months ago

Apologies, I missed this issue. Dealing with wrapped lines is notoriously difficult. If you use <C-d>/<C-u> in your document you'll notice that while the number of lines you move is more or less respected your cursor ends up on different heights. Essentially you need to choose to either respect the amount of lines moved or the height of the cursor. For scrolling my opinion is that keeping the cursor at the same height during the scrolling animation (and final position) is preferable and what most people would expect.

cathaysia commented 9 months ago

Thank you. In fact, except when writing asciidoc, I rarely encounter the problem of too long lines. Currently I often use visual rows to move the cursor