Skip to content

Conversation

@VioSea-hub
Copy link
Contributor

Fix the issue where document.getWordRangeAtPosition() retrieves incorrect positions due to inputting other content before the results from getStyles() are returned.

This can fix the issue where quickly typing a class name causes the completion to incorrectly overwrite content outside of the class attribute. For example:
Expected result:
<h class="test100"></h>
Actual result:
<h class=" test100></h>
<h class=" test100</h>
This situation becomes particularly noticeable when editor.quickSuggestions.string is enabled. The faster you type or the larger the css file, the more characters are overwritten.

This fix can resolve issue #278.
You can reproduce the issue using the files in this zip archive.
html-class-test.zip

…ct positions due to changes in the document before the results from getStyles() are returned.
@ecmel ecmel merged commit 1046c37 into ecmel:master Dec 12, 2024
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.

2 participants