Skip to content

Commit e9f17a5

Browse files
committed
1 parent ec700fa commit e9f17a5

File tree

5 files changed

+20
-1
lines changed

5 files changed

+20
-1
lines changed

src/vs/editor/browser/editorBrowser.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1086,6 +1086,12 @@ export interface ICodeEditor extends editorCommon.IEditor {
10861086
hasModel(): this is IActiveCodeEditor;
10871087

10881088
setBanner(bannerDomNode: HTMLElement | null, height: number): void;
1089+
1090+
/**
1091+
* Is called when the model has been set, view state was restored and options are updated.
1092+
* This is the best place to render UI.
1093+
*/
1094+
handleInitialized?(): void;
10891095
}
10901096

10911097
/**

src/vs/editor/browser/widget/codeEditorWidget.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1021,6 +1021,10 @@ export class CodeEditorWidget extends Disposable implements editorBrowser.ICodeE
10211021
}
10221022
}
10231023

1024+
public handleInitialized(): void {
1025+
this._getViewModel()?.visibleLinesStabilized();
1026+
}
1027+
10241028
public onVisible(): void {
10251029
this._modelData?.view.refreshFocusState();
10261030
}

src/vs/editor/common/model/tokenizationTextModelPart.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -642,7 +642,7 @@ class AttachedViewHandler extends Disposable {
642642
}
643643

644644
private update(): void {
645-
if (equals(this._computedLineRanges, this._lineRanges)) {
645+
if (equals(this._computedLineRanges, this._lineRanges, (a, b) => a.equals(b))) {
646646
return;
647647
}
648648
this._computedLineRanges = this._lineRanges;

src/vs/monaco.d.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6065,6 +6065,11 @@ declare namespace monaco.editor {
60656065
*/
60666066
applyFontInfo(target: HTMLElement): void;
60676067
setBanner(bannerDomNode: HTMLElement | null, height: number): void;
6068+
/**
6069+
* Is called when the model has been set, view state was restored and options are updated.
6070+
* This is the best place to render UI.
6071+
*/
6072+
handleInitialized?(): void;
60686073
}
60696074

60706075
/**

src/vs/workbench/contrib/files/browser/editors/textFileEditor.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,10 @@ export class TextFileEditor extends AbstractTextCodeEditor<ICodeEditorViewState>
148148
// a resolved model might have more specific information about being
149149
// readonly or not that the input did not have.
150150
control.updateOptions(this.getReadonlyConfiguration(textFileModel.isReadonly()));
151+
152+
if (control.handleInitialized) {
153+
control.handleInitialized();
154+
}
151155
} catch (error) {
152156
await this.handleSetInputError(error, input, options);
153157
}

0 commit comments

Comments
 (0)