not rendering when model is too large for tokenization

This commit is contained in:
Aiday Marlen Kyzy
2023-08-23 14:57:53 +02:00
parent 6885d66040
commit 8e524deece
2 changed files with 3 additions and 4 deletions
@@ -370,7 +370,6 @@ export class StickyScrollController extends Disposable implements IEditorContrib
private _readConfiguration() {
const options = this._editor.getOption(EditorOption.stickyScroll);
if (options.enabled === false) {
this._editor.removeOverlayWidget(this._stickyScrollWidget);
this._sessionStore.clear();
@@ -429,10 +428,10 @@ export class StickyScrollController extends Disposable implements IEditorContrib
}
private _renderStickyScroll() {
if (!(this._editor.hasModel())) {
const model = this._editor.getModel();
if (!model || model.isTooLargeForTokenization()) {
return;
}
const model = this._editor.getModel();
const stickyLineVersion = this._stickyLineCandidateProvider.getVersionId();
if (stickyLineVersion === undefined || stickyLineVersion === model.getVersionId()) {
this._widgetState = this.findScrollWidgetState();
@@ -44,7 +44,7 @@ export class LargeFileOptimizationsWarner extends Disposable implements IEditorC
'Variable 0 will be a file name.'
]
},
"{0}: tokenization, wrapping and folding have been turned off for this large file in order to reduce memory usage and avoid freezing or crashing.",
"{0}: tokenization, wrapping, folding and sticky scroll have been turned off for this large file in order to reduce memory usage and avoid freezing or crashing.",
path.basename(model.uri.path)
);