Skip to content

Commit

Permalink
Added try catch block for the case when LineDecorations.filter return…
Browse files Browse the repository at this point in the history
…s an error
  • Loading branch information
aiday-mar committed Jul 25, 2022
1 parent ee903b0 commit 3c87327
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/vs/editor/contrib/stickyScroll/browser/stickyScroll.ts
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,13 @@ class StickyScrollCodeLine {
const root: HTMLElement = document.createElement('div');
const modifiedLine = this._line.replace(/\s/g, '\xa0');
const lineRenderingData = this._editor._getViewModel().getViewLineRenderingData(this._editor.getVisibleRangesPlusViewportAboveBelow()[0], this._lineNumber);
const actualInlineDecorations = LineDecoration.filter(lineRenderingData.inlineDecorations, this._lineNumber, lineRenderingData.minColumn, lineRenderingData.maxColumn);
let actualInlineDecorations: LineDecoration[];
try {
actualInlineDecorations = LineDecoration.filter(lineRenderingData.inlineDecorations, this._lineNumber, lineRenderingData.minColumn, lineRenderingData.maxColumn);
} catch (err) {
console.log(err);
actualInlineDecorations = [];
}
const renderLineInput: RenderLineInput = new RenderLineInput(true, true, modifiedLine, lineRenderingData.continuesWithWrappedLine,
lineRenderingData.isBasicASCII, lineRenderingData.containsRTL, 0, lineRenderingData.tokens, actualInlineDecorations, lineRenderingData.tabSize,
lineRenderingData.startVisibleColumn, 1, 1, 1, 500, 'none', true, true, null);
Expand Down

0 comments on commit 3c87327

Please sign in to comment.