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

Pasting text ==> Error: Illegal argument: character must be non-negative #3

Open
rioj7 opened this issue Jan 6, 2022 · 0 comments
Open

Comments

@rioj7
Copy link

rioj7 commented Jan 6, 2022

After pasting some multi-line text block I got the following error (Developer Console)

Error: Illegal argument: character must be non-negative
	at Object.rangeDeltaNewRange (.vscode\extensions\draivin.hscopes-0.0.6\out\src\text-util.js:49:42)
	at DocumentController.applyChanges (.vscode\extensions\draivin.hscopes-0.0.6\out\src\document.js:74:44)
	at DocumentController.onChangeDocument (.vscode\extensions\draivin.hscopes-0.0.6\out\src\document.js:83:14)
	at .vscode\extensions\draivin.hscopes-0.0.6\out\src\document.js:18:22

It tries to create a vscode.Range with a negative character value on a line.

Looking at the code in toRangeDelta the variable charsDelta can become negative if the new range is shorter at the last line.

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

1 participant