mirror of
https://github.com/Microsoft/vscode
synced 2024-10-30 18:05:11 +00:00
parent
da40432b85
commit
c3ff42d57a
1 changed files with 6 additions and 1 deletions
|
@ -1323,7 +1323,12 @@ export class TextModel extends Disposable implements model.ITextModel {
|
|||
for (let i = 0, len = contentChanges.length; i < len; i++) {
|
||||
const change = contentChanges[i];
|
||||
const [eolCount, firstLineLength] = TextModel._eolCount(change.text);
|
||||
this._tokens.applyEdits(change.range, eolCount, firstLineLength);
|
||||
try {
|
||||
this._tokens.applyEdits(change.range, eolCount, firstLineLength);
|
||||
} catch (err) {
|
||||
// emergency recovery => reset tokens
|
||||
this._tokens = new ModelLinesTokens(this._tokens.languageIdentifier, this._tokens.tokenizationSupport);
|
||||
}
|
||||
this._onDidChangeDecorations.fire();
|
||||
this._decorationsTree.acceptReplace(change.rangeOffset, change.rangeLength, change.text.length, change.forceMoveMarkers);
|
||||
|
||||
|
|
Loading…
Reference in a new issue