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

Fixed issue 36: Illegal argument: character must be non-negative #37

Merged
merged 1 commit into from
Jul 5, 2023
Merged

Conversation

rupumped
Copy link
Contributor

If the W3C violation occurs in the first character of the file, e.g. if the file references a legacy doctype, message.hiliteStart will be 0, and message.hiliteStart-1 will be negative, causing the error Illegal argument: character must be non-negative. This was a quick fix: instead of passing message.hiliteStart-1 directly as a parameter of vscode.Position, pass Math.max(message.hiliteStart-1,0), which forces the character to be nonnegative.

@celian-rib
Copy link
Owner

Thanks @rupumped, I'll deploy the fix as soon as possible.

@celian-rib celian-rib linked an issue Jul 5, 2023 that may be closed by this pull request
@celian-rib celian-rib merged commit 18a1f29 into celian-rib:main Jul 5, 2023
1 check passed
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.

Illegal argument: character must be non-negative
2 participants