From ca3a2d44c133b927eb4f32fdf38edf61159ef5bb Mon Sep 17 00:00:00 2001 From: Ardent Briar <67130289+ardentbriar@users.noreply.github.com> Date: Sun, 21 Jun 2020 13:24:30 -0600 Subject: [PATCH] Add autoopen option Adds boolean config setting Show On Attach to control whether the tree view is automatically shown when a new window is opened. Default is true to preserve current behavior. --- lib/tree-view-package.js | 5 ++++- package.json | 5 +++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/tree-view-package.js b/lib/tree-view-package.js index f624e03d..5d2bdfc9 100644 --- a/lib/tree-view-package.js +++ b/lib/tree-view-package.js @@ -21,7 +21,10 @@ class TreeViewPackage { })) const treeView = this.getTreeViewInstance() - const showOnAttach = !atom.workspace.getActivePaneItem() + const showOnAttach = ( + atom.config.get('tree-view.showOnAttach') && + !atom.workspace.getActivePaneItem() + ) this.treeViewOpenPromise = atom.workspace.open(treeView, { activatePane: showOnAttach, activateItem: showOnAttach diff --git a/package.json b/package.json index e0adbe39..a088c63f 100644 --- a/package.json +++ b/package.json @@ -94,6 +94,11 @@ "type": "boolean", "default": false, "description": "When opening a file, always focus an already-existing view of the file even if it's in another pane." + }, + "showOnAttach": { + "type": "boolean", + "default": true, + "description": "Show tree view when a new window is opened." } } }