mirror of
https://github.com/atom/atom.git
synced 2026-04-06 03:02:13 -04:00
Selecting file in tree view opens it in an editor and focuses is
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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()))
|
||||
|
||||
Reference in New Issue
Block a user