From 758131cc02549571e54d9529a05dd69a287854be Mon Sep 17 00:00:00 2001 From: partouf Date: Mon, 24 Oct 2022 11:55:20 +0200 Subject: [PATCH] fix #4194 --- static/panes/editor.ts | 63 +++++++++++++++++++++++------------------- static/panes/pane.ts | 3 ++ 2 files changed, 37 insertions(+), 29 deletions(-) diff --git a/static/panes/editor.ts b/static/panes/editor.ts index 92b481dbd..0729ecd2b 100644 --- a/static/panes/editor.ts +++ b/static/panes/editor.ts @@ -60,20 +60,20 @@ const languages = options.languages as Record; // eslint-disable-next-line max-statements export class Editor extends MonacoPane { - private readonly id: number; - private readonly ourCompilers: Record; - private readonly ourExecutors: Record; - private readonly httpRoot: string; - private readonly asmByCompiler: Record; - private readonly defaultFileByCompiler: Record; - private readonly busyCompilers: Record; + private id: number; + private ourCompilers: Record; + private ourExecutors: Record; + private httpRoot: string; + private asmByCompiler: Record; + private defaultFileByCompiler: Record; + private busyCompilers: Record; private colours: string[]; - private readonly treeCompilers: Record | undefined>; + private treeCompilers: Record | undefined>; private decorations: Record; private prevDecorations: string[]; private extraDecorations?: Decoration[]; private fadeTimeoutId: NodeJS.Timeout | null; - private readonly editorSourceByLang: Record; + private editorSourceByLang: Record; private alertSystem: Alert; private filename: string | false; private awaitingInitialResults: boolean; @@ -104,30 +104,10 @@ export class Editor extends MonacoPane; this.alertSystem = new Alert(); this.alertSystem.prefixMessage = 'Editor #' + this.id; - this.awaitingInitialResults = false; - - this.revealJumpStack = []; - if (this.currentLanguage) this.onLanguageChange(this.currentLanguage.id, true); if (state.source !== undefined) { @@ -168,6 +148,28 @@ export class Editor extends MonacoPane; + + this.awaitingInitialResults = false; + + this.revealJumpStack = []; + } + override registerOpeningAnalyticsEvent(): void { ga.proxy('send', { hitType: 'event', @@ -492,6 +494,7 @@ export class Editor extends MonacoPane { this.paneRenaming = new PaneRenaming(this, state); + this.initializeDefaults(); this.initializeGlobalDependentProperties(); this.initializeStateDependentProperties(state); @@ -116,6 +117,8 @@ export abstract class Pane { */ abstract registerOpeningAnalyticsEvent(): void; + initializeDefaults(): void {} + initializeGlobalDependentProperties(): void {} initializeStateDependentProperties(state: S): void {}