mirror of
https://github.com/atom/atom.git
synced 2026-01-23 13:58:08 -05:00
Use active pane item for path
Previously the active view was used to obtain the path. The ImageView does not provide a path and was causing an exception to be thrown when getPath was called on it unguarded. Closes #568
This commit is contained in:
@@ -129,8 +129,10 @@ class TreeView extends ScrollView
|
||||
else
|
||||
@root = null
|
||||
|
||||
getActivePath: -> rootView.getActivePaneItem()?.getPath?()
|
||||
|
||||
selectActiveFile: ->
|
||||
if activeFilePath = rootView.getActiveView()?.getPath?()
|
||||
if activeFilePath = @getActivePath()
|
||||
@selectEntryForPath(activeFilePath)
|
||||
else
|
||||
@deselect()
|
||||
@@ -139,7 +141,7 @@ class TreeView extends ScrollView
|
||||
@attach()
|
||||
@focus()
|
||||
|
||||
return unless activeFilePath = rootView.getActiveView()?.getPath()
|
||||
return unless activeFilePath = @getActivePath()
|
||||
|
||||
activePathComponents = project.relativize(activeFilePath).split('/')
|
||||
currentPath = project.getPath().replace(/\/$/, '')
|
||||
|
||||
Reference in New Issue
Block a user