From 0a9abcc7ed69d4e4ab0bee8525cd7413e4107cf4 Mon Sep 17 00:00:00 2001 From: Daan Vanden Bosch Date: Mon, 26 Aug 2019 19:31:01 +0200 Subject: [PATCH] ASM editor undo now correctly resets when a new quest is loaded. --- src/core/gui/index.css | 4 ++-- src/quest_editor/gui/AsmEditorView.ts | 2 ++ src/quest_editor/stores/AsmEditorStore.ts | 5 +++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/core/gui/index.css b/src/core/gui/index.css index 689b98df..af80d77f 100644 --- a/src/core/gui/index.css +++ b/src/core/gui/index.css @@ -18,8 +18,8 @@ --input-text-color: hsl(0, 0%, 75%); --input-text-color-disabled: var(--text-color-disabled); --input-border: solid 1px hsl(0, 0%, 25%); - --input-border-hover: hsl(0, 0%, 35%); - --input-border-focus: hsl(0, 0%, 45%); + --input-border-hover: hsl(0, 0%, 30%); + --input-border-focus: hsl(0, 0%, 40%); --input-border-disabled: solid 1px hsl(0, 0%, 20%); --input-inner-border: solid 1px hsl(0, 0%, 5%); diff --git a/src/quest_editor/gui/AsmEditorView.ts b/src/quest_editor/gui/AsmEditorView.ts index 776aaf89..44ab682c 100644 --- a/src/quest_editor/gui/AsmEditorView.ts +++ b/src/quest_editor/gui/AsmEditorView.ts @@ -35,6 +35,8 @@ export class AsmEditorView extends ResizableView { wordBasedSuggestions: false, wordWrap: "on", wrappingIndent: "indent", + renderIndentGuides: false, + folding: false, }), ); diff --git a/src/quest_editor/stores/AsmEditorStore.ts b/src/quest_editor/stores/AsmEditorStore.ts index 33f00815..05eb6b46 100644 --- a/src/quest_editor/stores/AsmEditorStore.ts +++ b/src/quest_editor/stores/AsmEditorStore.ts @@ -79,7 +79,7 @@ export class AsmEditorStore implements Disposable { constructor() { this.disposer.add_all( - quest_editor_store.current_quest.observe(({ value }) => this.update_model(value), { + quest_editor_store.current_quest.observe(({ value }) => this.quest_changed(value), { call_now: true, }), @@ -93,7 +93,8 @@ export class AsmEditorStore implements Disposable { this.disposer.dispose(); } - private update_model(quest?: QuestModel): void { + private quest_changed(quest?: QuestModel): void { + this.undo.reset(); this.model_disposer.dispose_all(); if (quest) {