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:
Kevin Sawicki
2013-06-04 13:25:41 -07:00
parent 36ddbe99a1
commit 6c8063b26a

View File

@@ -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(/\/$/, '')