-
-
Notifications
You must be signed in to change notification settings - Fork 84
neovim: Support hats #2567
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
Comments
Please forgive me for just dumping thoughts here: since graphical hats are going to be very difficult in a terminal based application, I think we could hack something functional together using virtual text and diacritics. A quick test with nerd fonts and the kitty app shows that pasting these diacritics works well even with arbitrary letters. They sometimes look quite funky with symbols though, often offset. I don't think there is support for coloring just the diacritics so we would have to color entire letters. Ugly, But I can still see this being pretty functional and offering a big boost to cursorless neovim functionality |
I've been researching this some more and I think there are some ok options that we could build to move forward here other than diacritics. I'm mostly spitballing currently and dumping research notes, although I definitely have some appetite to move forward with this (but might need help plugging into cursorless from neovim to decide where the hat gets placed) First, for the different shapes, other than the obvious option of using some closely matching nerd font character or unicode character, we could use a graphics protocol like the kitty graphics protocol to render the shapes properly. From my reading of the protocol, this would require us to convert the svgs two bitmaps and also probably embed the colors directly (i.e. have a folder, possibly a temporary one created on startup, that contains every shape in every one of the users colors.) One useful thing that kitty graphics protocol allows you to do is render an image anchored to an empty unicode character displayed by the editor, including with offsets. This would probably be the most useful way to ensure that we track an actual character rather than having to consider the pixel positioning of the hats ourselves We would use extmarks to create the unicode character as an invisible virtual text character overlaying or beside the target, and render the hats relative to that (i.e. above it, or even on it depending on the below workaround). Workarounds for placement of the hat:
My thinking is that 2 is easiest currently, rendered with the hat in the gap itself (i.e. over the virtual character). I would potentially also implement number 1 and 4, and have it as a user option. No idea what the performance it would be of rendering a whole bunch of little images in the terminal, but if we can make them small bitmaps it might be ok... |
No description provided.
The text was updated successfully, but these errors were encountered: