ASM editor undo now correctly resets when a new quest is loaded.

This commit is contained in:
Daan Vanden Bosch 2019-08-26 19:31:01 +02:00
parent 4e38896676
commit 0a9abcc7ed
3 changed files with 7 additions and 4 deletions

View File

@ -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%);

View File

@ -35,6 +35,8 @@ export class AsmEditorView extends ResizableView {
wordBasedSuggestions: false,
wordWrap: "on",
wrappingIndent: "indent",
renderIndentGuides: false,
folding: false,
}),
);

View File

@ -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) {