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

Bug: Highlighting synchronization with shown text #192

Open
AntonPieper opened this issue Jul 30, 2024 · 2 comments
Open

Bug: Highlighting synchronization with shown text #192

AntonPieper opened this issue Jul 30, 2024 · 2 comments

Comments

@AntonPieper
Copy link
Contributor

If I remove N characters and add N characters again without changing the token type within the update delay, the highlighting was removed due to how spans work (but does not reappear). This happens, because highlighting does not happen immediately but only after a period of inactivity and the diff algorithm is based on current tokens and last highlighted tokens. A naive/simple fix to this issue is to track the first and last edited character and then always replace that range with the new highlight tokens. Another way of fixing it would be to immediately apply the highlighting as soon as the tokenization finishes.

@AntonPieper AntonPieper changed the title Bug: Highlighting Bug: Highlighting synchronization with shown text Jul 30, 2024
@markusfisch
Copy link
Owner

Hm, I somehow can't really reproduce this 🤔

Could you please give an example like removing and adding "oor" from "gl_FragCoord" or something like that?

@AntonPieper
Copy link
Contributor Author

Of course, I can give an example:

It should be:

  • vec4 -> v -> vec4

But what happens:

  • vec4 -> v -> v ec4

This happens at the boundaries of tokens, because they are fixed to words/characters and not rows/columns.

Another extreme example:

(Works best with highest update delay)

Select All -> Copy -> Delete all -> Paste

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

No branches or pull requests

2 participants