mirror of
https://github.com/atom/atom.git
synced 2026-01-23 05:48:10 -05:00
Don't automatically focus when attach is called
Only focus when toggling the tree view or revealing an active file. This prevents the tree view from stealing focus when it is attached during deserialization.
This commit is contained in:
@@ -72,15 +72,12 @@ class TreeView extends ScrollView
|
||||
if @hasFocus()
|
||||
@detach()
|
||||
else
|
||||
if @hasParent()
|
||||
@focus()
|
||||
else
|
||||
@attach()
|
||||
@attach() unless @hasParent()
|
||||
@focus()
|
||||
|
||||
attach: ->
|
||||
return unless project.getPath()
|
||||
rootView.horizontal.prepend(this)
|
||||
@focus()
|
||||
|
||||
detach: ->
|
||||
@scrollTopAfterAttach = @scrollTop()
|
||||
@@ -134,6 +131,7 @@ class TreeView extends ScrollView
|
||||
|
||||
revealActiveFile: ->
|
||||
@attach()
|
||||
@focus()
|
||||
|
||||
return unless activeFilePath = rootView.getActiveEditor()?.getPath()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user