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

fix(highlight): remove duplicate visual selection highlight #1643

Merged
merged 1 commit into from
Nov 21, 2023

Conversation

theol0403
Copy link
Member

With #1597, applying the Visual highlight is no longer needed, we can entirely rely on vscode's selection.

@xiyaowong
Copy link
Collaborator

There are still some problems when multi-byte characters exist, especially when emoji exist. Might be better to keep Visual as feedback

@theol0403
Copy link
Member Author

What kind of problems? Wouldn't it also cause cursor position problems? Not sure when the highlight will be more accurate than cursor position.

@xiyaowong

This comment was marked as outdated.

@xiyaowong
Copy link
Collaborator

However, most people do not use multi-byte characters, so deleting Visual is not a big deal.

In fact, Visual also has a potential function, that is, when the highlighting (or extmarks) is wrong, you can clear the wrong highlighting by selecting the area 😂

@xiyaowong
Copy link
Collaborator

Weird, I can't reproduce the previous bug again. Anyway, the main issue now is that it occurs when emojis are present. It can be fixed later when someone provides feedback.

@xiyaowong
Copy link
Collaborator

btw, there is a part of the logic here specifically for handling Visual. It is recommended to keep it.

// Treat all colors mixed with Visual as Visual to avoid defective rendering due to disjointed decoration ranges.
private visualHighlightId?: number;
private visualHighlightIds: number[] = [];

@theol0403
Copy link
Member Author

Does clearing the visual highlight in this PR affect that?

@xiyaowong
Copy link
Collaborator

Some users may set up Visual by themselves.

@theol0403 theol0403 merged commit d02dbde into vscode-neovim:master Nov 21, 2023
8 checks passed
@theol0403 theol0403 deleted the fix/duplicate_highlight branch November 21, 2023 04:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants