-
Notifications
You must be signed in to change notification settings - Fork 44
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
feat: attempt to hide cursor when leaping #143
Conversation
Nice, thank you! I'm totally fine with this for now, one can always set |
It's unfortunately not as straightforward. There's some weird bugs in Neovim where cursor updates are delayed. Check the Noice code for more details: https://github.com/folke/noice.nvim/blob/main/lua/noice/util/hacks.lua#L255-L283 Having Noice with Leap will also lead to issues with this PR since there will likely be race conditions where the wrong cursor is restored. Would it be possible to set a |
Any of the above is fine, but I'm not sure I understand the implications correctly (sorry, I'm a bit low on mental energy): does this mean that cursor hiding will only work for one of the two plugins? |
Hrm... I think if either plugin has to know about each other, that's probably worse than doing nothing in leap, for now - assuming the issue will be addressed in neovim core some time ;). A third option would be some documentation in the leap README about how one might hide the cursor, with some additional caveats for Noice users. (But I'm cool with the above suggestions, too - just LMK which to implement, in addition to that |
@ggandor Noice disables the cursor whenever some code does This means that the leap cursor issue doesn't exist for users that also use Noice. What Noice (and with this PR leap does) when the cursor needs to hide:
Now, when both leap or Noice would be doing this, there's a very likely race-condition, where for example:
The easiest way would be to skip hiding the cursor in leap when |
Ah, thanks for the clarification, great.
This is what we'll do then. |
Ok, I think I've made the requested changes |
But what about the delaying issue mentioned above? @folke could you give us a TLDR on that? :) |
@ggandor Ah sorry, I had missed that. Ok, after reading the code, and the issue that lead to some of it (folke/noice.nvim#114), I'm left feeling like I just don't really understand what's going on. I'm happy to drop this feature and say Hiding Cursor in Neovim Considered Too Complicated. Is anyone else interested in picking up this PR from here? |
Rendered obsolete by neovim/neovim#27858. |
This PR partially addresses #70 by applying a workaround to neovim/neovim#20793 suggested by @folke: just hide and restore the cursor.
The implementation is... weird :/. I've tried to explain what's going on in a comment. Suggestions for wording and/or alternative implementation(s) welcome.