b0o / incline.nvim

🎈 Floating statuslines for Neovim, winbar alternative
MIT License
759 stars 14 forks source link

Error message popping up #21

Closed romgrk closed 2 years ago

romgrk commented 2 years ago

Hey,

I have a custom function that is called on a keymap and waits for user input with getchar(). While neovim waits for the char from getchar(), it seems incline tries to do some work but isn't allowed due to the context. Is it possible to either fix, or if it's simpler catch and hide the errors below:

image

Thanks

b0o commented 2 years ago

Hey, I am having trouble figuring out how to reproduce this. Could you share the mapping you are using to make this happen?

romgrk commented 2 years ago

Here: https://github.com/romgrk/nvim/blob/master/rc/keymap.vim#L120-L147

It seems like incline is trying to call a neovim API function while getchar() is waiting for a character. The textlock thing is probably in effect, so you probably need to wrap in vim.schedule your timer callbacks.

b0o commented 2 years ago

Please give the latest version a try. Also see https://github.com/neovim/neovim/issues/16278

b0o commented 2 years ago

Hey @romgrk just checking in with you, did this solve your issue?

romgrk commented 2 years ago

Can't reproduce anymore, thanks!