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()))