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 the issue where document.getWordRangeAtPosition() returns incorre… #299

Merged
merged 1 commit into from
Dec 12, 2024

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