Fixes #43238: Do not comput brackets if the cursor count is too high

上级 1e108024
......@@ -281,6 +281,14 @@ export class BracketMatchingController extends Disposable implements editorCommo
return;
}
const selections = this._editor.getSelections();
if (selections.length > 100) {
// no bracket matching for high numbers of selections
this._lastBracketsData = [];
this._lastVersionId = 0;
return;
}
const model = this._editor.getModel();
const versionId = model.getVersionId();
let previousData: BracketsData[] = [];
......@@ -289,8 +297,6 @@ export class BracketMatchingController extends Disposable implements editorCommo
previousData = this._lastBracketsData;
}
const selections = this._editor.getSelections();
let positions: Position[] = [], positionsLen = 0;
for (let i = 0, len = selections.length; i < len; i++) {
let selection = selections[i];
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册