cinnamon.nvim icon indicating copy to clipboard operation
cinnamon.nvim copied to clipboard

Cinnamon not scrolling in certain cases

Open OXY2DEV opened this issue 1 year ago • 6 comments

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
})

OXY2DEV avatar Feb 23 '24 03:02 OXY2DEV

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?

declancm avatar Apr 26 '24 04:04 declancm

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.

OXY2DEV avatar Apr 26 '24 06:04 OXY2DEV

I accidentally clicked the wrong button, my bad 😅.

OXY2DEV avatar Apr 26 '24 06:04 OXY2DEV

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!

declancm avatar May 17 '24 09:05 declancm

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.

OXY2DEV avatar May 17 '24 10:05 OXY2DEV

That's good to know! I'll try and work on improving that experience

declancm avatar May 17 '24 19:05 declancm

Just merged in a full rewrite of the plugin which includes non-blocking delays :)

declancm avatar Jun 26 '24 07:06 declancm