-
-
Notifications
You must be signed in to change notification settings - Fork 198
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
fix(highlights): fix misaligned rendering in visual mode #1401
Conversation
Selections are already highlighted by vscode
`nvim_buf_set_name` will do filetype detection, so we must override tab options after vim initializes defaults. If the indentation options for nvim and vscode don't match, this can lead to misaligned rendering when tabs are present.
Thanks for this!! For the visual selection highlight, I opted to include it because there are some cases where neovim does not notify vscode that the visual selection has been updated. neovim/neovim#19708. I think this just smooths the edges and makes sure you always get some feedback that the visual selection has updated, albeit where the vscode selection will be temporarily incorrect. Does this also fix the issue I found in #1144? I was able to reproduce the issue in terminal neovim, which was that when the "fake" visual cursor is on top of a tabstop character, it doesn't render the tabstop, messing up the highlighting. You probably just don't see the problem because you disabled visual highlight. I'm not sure about the breaking test, it could be from unrelated changes/neovim update, or there could be some edge case you've uncovered. Thanks for looking into this! |
This comment was marked as outdated.
This comment was marked as outdated.
@theol0403 Well, it's been a long day of debugging. |
Thanks for all the debugging! Unfortunately, I don't think this fully solves any of the linked PRs. I think that I believe you've fixed a real bug, but I am still able to reproduce, with tabs and visual selection enabled, the issues. |
This reverts commit 0ebe821.
This comment was marked as outdated.
This comment was marked as outdated.
Well, I've reproduced these issues, too. That's sad |
@theol0403 All the issues I encountered so far have been fixed 🏃 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work, looks awesome!
Just wanna pop in to this PR and say this has significantly increased my quality of life. Thank you. |
Cursor
highlight ranges.fixes #1374, fixes #1144, fixes #1368