Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quickly switching buffers can break the animation #2

Open
DanCardin opened this issue Jun 25, 2020 · 5 comments
Open

Quickly switching buffers can break the animation #2

DanCardin opened this issue Jun 25, 2020 · 5 comments
Assignees
Labels
neovim bug Bug in neovim itself

Comments

@DanCardin
Copy link

I've got bprev and bnext bound with <leader> mappings which make it pretty easy to chain them together more quickly than the animation can finish.

It seems like, depending on timing, I can get:

  • the visual indicator to not show up at all on the final buffer you land on
  • the visual indicator to remain visible until some other key is pressed

(neither of these are particularly significant to me, just figured I'd mention it, great plugin!)

@DanilaMihailov
Copy link
Owner

the visual indicator to remain visible until some other key is pressed

I think it is just how Vim works. I use timer_start() for animation and it says in docs "When the system is busy or Vim is not waiting for input the time will be longer." so when you press other keys, Vim is waiting for your key combination to finish and blocks everything else, thats what beacon is not hiding in time.

the visual indicator to not show up at all on the final buffer you land on

Maybe it is the same problem with timer_start(), I do see it myself sometimes.

I think there is few ways I can get around this limitations, and it should make animations more robust. I will look into it.

Thanks for feedback :) I'll keep this issue open, until I figure out a way to make animations better.

@DanilaMihailov DanilaMihailov self-assigned this Jun 25, 2020
@DanilaMihailov DanilaMihailov added the enhancement New feature or request label Jun 25, 2020
@DanilaMihailov
Copy link
Owner

the visual indicator to not show up at all on the final buffer you land on

I think I fixed this in a new release, there was timer I forgot to clear :)

@DanCardin
Copy link
Author

DanCardin commented Jun 26, 2020

I agree, I think this fixed the not showing up at all bit.

And I figured out how to easily repro the "bug" where it stays:
My leader is <space>, so I make a big move then hit space while it's animating.

EDIT: Actually, I guess this is sort of what you said originally. Though I suppose I'd expect the indicator to still eventually disappear after the leader input times out?

@DanilaMihailov
Copy link
Owner

Though I suppose I'd expect the indicator to still eventually disappear after the leader input times out?

Good point. Just checked, it disappears for me. I do 11j<space> and see indicator freeze, but after around a second it disappears. But if I do 11j<C-w> it just stays forever waiting for next key.

I actually trying to support vim8 now and I don't see this problem there. I guess it's neovim only behaviour. I hope I can fix it by using jobs.

@DanilaMihailov DanilaMihailov added the bug Something isn't working label Jun 27, 2020
@DanilaMihailov
Copy link
Owner

So it seems to be neovim bug, when neovim is in operator-pending mode (waiting for user to finish key combination) it stops all timer callbacks (and jobs too), until the end of operator-pending mode. I don't see how I can fix it now.

There is relevant neovim issue neovim/neovim#7350.

@DanilaMihailov DanilaMihailov added neovim bug Bug in neovim itself and removed bug Something isn't working enhancement New feature or request labels Jul 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
neovim bug Bug in neovim itself
Projects
None yet
Development

No branches or pull requests

2 participants