cinnamon.nvim
cinnamon.nvim copied to clipboard
Cinnamon not scrolling in certain cases
Hi. I have encountered a weird issue where cinnamon will not scroll if I am on the top 2 lines and the bottom 2 lines.
If I go to the topmost line on my screen and try <Page-up> it would instead just send my cursor to the 2nd line and not scroll.
Is this intended? Or am I doing something wrong?
My setup is
require("cinnamon").setup({
extra_keymaps = true,
default_delay = 15,
scroll_limit = 150
})
Hi! I haven't been able to recreate the issue sadly. Have you tried doing the same <page-up> command from the same line with the plugin enabled and with it disabled? Is there a difference in behavior?
https://github.com/declancm/cinnamon.nvim/assets/122956967/7288f951-d9d9-492c-abf6-1229bb818fc4
As you can see, if I attempt to scroll with the cursor in the top 2 or the bottom 2 lines of the buffer the plugin doesn't do anything.
It looks like the plugin gets confused about where to scroll so it just goes to some default line(the 2nd line from the top or the bottom of the buffer).
https://github.com/declancm/cinnamon.nvim/assets/122956967/a54cf868-35dc-46f5-a8c7-dc0213f8c7e7
Here I have disabled the plugin and scroll seems to work like normal.
I accidentally clicked the wrong button, my bad 😅.
I think its because the view smooth scrolling is done with ctrl-y which stops once the top of the file hits the top of the window, unlike page-up. Im working on finding a fix!
Well, that explains the issue. But, I kinda stopped using the plugin(due to plugins with animations not liking each others).
Last I checked the plugin used sleep for the animations. Is it possible to use a timer for it? Because, the plugin starts to glitch everything out if some other plugin(e.g. nvim-notify) is already doing it's own transition or if the WindowResize event gets fired mid scroll.
I mean, libuv should already be managing all the active timers automatically, so it should stop any visual bugs from appearing due to multiple plugins trying to change something in the buffer.
That's good to know! I'll try and work on improving that experience
Just merged in a full rewrite of the plugin which includes non-blocking delays :)