From 0951b86acc2962fd8be8e052c42dbc01b1457f79 Mon Sep 17 00:00:00 2001 From: Corey Johnson Date: Wed, 2 May 2012 08:29:22 -0700 Subject: [PATCH] Selecting file in tree view opens it in an editor and focuses is --- spec/extensions/tree-view-spec.coffee | 2 +- src/extensions/tree-view/tree-view.coffee | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/extensions/tree-view-spec.coffee b/spec/extensions/tree-view-spec.coffee index 02bdc6a2c..1e03a9594 100644 --- a/spec/extensions/tree-view-spec.coffee +++ b/spec/extensions/tree-view-spec.coffee @@ -89,7 +89,7 @@ describe "TreeView", -> expect(grandchild.directory.subscriptionCount()).toBe 0 describe "when a file is clicked", -> - it "opens it in the active editor and selects it", -> + it "opens it in the active editor, focuses it and selects it", -> expect(rootView.activeEditor()).toBeUndefined() sampleJs.click() diff --git a/src/extensions/tree-view/tree-view.coffee b/src/extensions/tree-view/tree-view.coffee index e98876df3..935b268c4 100644 --- a/src/extensions/tree-view/tree-view.coffee +++ b/src/extensions/tree-view/tree-view.coffee @@ -37,7 +37,6 @@ class TreeView extends View @on 'tree-view:unfocus', => @rootView.activeEditor().focus() @rootView.on 'tree-view:focus', => this.focus() - deactivate: -> @root.unwatchEntries() @@ -82,6 +81,7 @@ class TreeView extends View selectedEntry.view().toggleExpansion() else if (selectedEntry instanceof FileView) @rootView.open(selectedEntry.getPath()) + @rootView.focus() move: -> @rootView.append(new MoveDialog(@rootView.project, @selectedEntry().getPath()))