From 9a33556eeba8111385b6ad8bb4acf55ce3764ad8 Mon Sep 17 00:00:00 2001 From: ochafik Date: Sun, 26 Mar 2023 08:34:03 +0100 Subject: [PATCH] tie up logs visibility w/ tabs --- src/model.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/model.ts b/src/model.ts index 992b86f..59759b0 100644 --- a/src/model.ts +++ b/src/model.ts @@ -35,6 +35,13 @@ export class Model { } set logsVisible(value: boolean) { + if (value) { + if (this.state.view.layout.mode === 'single') { + this.changeSingleVisibility('editor'); + } else { + this.changeMultiVisibility('editor', true); + } + } this.mutate(s => s.view.logs = value); } @@ -58,6 +65,9 @@ export class Model { this.mutate(s => { if (s.view.layout.mode !== 'single') throw new Error('Wrong mode'); s.view.layout.focus = focus; + if (focus !== 'editor') { + s.view.logs = false; + } }); } @@ -69,6 +79,9 @@ export class Model { // Select at least one panel // s.view.layout.editor = true; s.view.layout[target] = !visible; + if (target === 'editor' && !visible) { + s.view.logs = false; + } } }) }