From 6c8063b26ad6b00a8a22da60c5e09d1ba21ff423 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Tue, 4 Jun 2013 13:25:41 -0700 Subject: [PATCH] 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 --- src/packages/tree-view/lib/tree-view.coffee | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/packages/tree-view/lib/tree-view.coffee b/src/packages/tree-view/lib/tree-view.coffee index 45a23ebe9..2df802ccf 100644 --- a/src/packages/tree-view/lib/tree-view.coffee +++ b/src/packages/tree-view/lib/tree-view.coffee @@ -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(/\/$/, '')