mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-09-21 16:08:24 +03: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:
parent
969327e822
commit
94a17e73ba
@ -72,15 +72,12 @@ class TreeView extends ScrollView
|
||||
if @hasFocus()
|
||||
@detach()
|
||||
else
|
||||
if @hasParent()
|
||||
@attach() unless @hasParent()
|
||||
@focus()
|
||||
else
|
||||
@attach()
|
||||
|
||||
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()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user