提交 1eab70bb 编写于 作者: P Peng Lyu

if we disable folding model for large file, we do not save view state as well.

上级 fbb4b942
...@@ -101,7 +101,7 @@ export class FoldingController implements IEditorContribution { ...@@ -101,7 +101,7 @@ export class FoldingController implements IEditorContribution {
*/ */
public saveViewState(): { collapsedRegions?: CollapseMemento, lineCount?: number } { public saveViewState(): { collapsedRegions?: CollapseMemento, lineCount?: number } {
let model = this.editor.getModel(); let model = this.editor.getModel();
if (!model || !this._isEnabled) { if (!model || !this._isEnabled || model.isTooLargeForTokenization()) {
return {}; return {};
} }
return { collapsedRegions: this.foldingModel.getMemento(), lineCount: model.getLineCount() }; return { collapsedRegions: this.foldingModel.getMemento(), lineCount: model.getLineCount() };
...@@ -112,7 +112,7 @@ export class FoldingController implements IEditorContribution { ...@@ -112,7 +112,7 @@ export class FoldingController implements IEditorContribution {
*/ */
public restoreViewState(state: { collapsedRegions?: CollapseMemento, lineCount?: number }): void { public restoreViewState(state: { collapsedRegions?: CollapseMemento, lineCount?: number }): void {
let model = this.editor.getModel(); let model = this.editor.getModel();
if (!model || !this._isEnabled) { if (!model || !this._isEnabled || model.isTooLargeForTokenization()) {
return; return;
} }
if (!state || !state.collapsedRegions || state.lineCount !== model.getLineCount()) { if (!state || !state.collapsedRegions || state.lineCount !== model.getLineCount()) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册