mirror of
https://github.com/atom/atom.git
synced 2026-01-23 22:08:08 -05:00
findPath
This commit is contained in:
@@ -32,7 +32,7 @@ class TreePane extends Pane
|
||||
else
|
||||
@tree.showDir path
|
||||
el.addClass 'open'
|
||||
list = @createList @tree.findPaths path
|
||||
list = @createList @tree.findPath(path).paths
|
||||
el.append list
|
||||
else
|
||||
el.addClass 'active'
|
||||
|
||||
@@ -62,6 +62,16 @@ class Tree extends Extension
|
||||
Storage.set @shownDirStorageKey(), dirs
|
||||
@unwatchDir dir, @watchDir
|
||||
|
||||
findPath: (searchPath, paths=@paths) ->
|
||||
found = null
|
||||
for obj in paths
|
||||
return found if found
|
||||
if obj.path is searchPath
|
||||
found = obj
|
||||
else if obj.paths
|
||||
found = @findPath searchPath, obj.paths
|
||||
found
|
||||
|
||||
findPaths: (root) ->
|
||||
paths = []
|
||||
|
||||
|
||||
Reference in New Issue
Block a user