mirror of
https://github.com/atom/atom.git
synced 2026-02-09 06:05:11 -05:00
Merge branch 'master' of github.com:probablycorey/Atomicity
Conflicts: src/atom/project.coffee
This commit is contained in:
@@ -14,7 +14,7 @@ class FileFinder extends Template
|
||||
urls: null
|
||||
maxResults: null
|
||||
|
||||
initialize: ({@urls}) ->
|
||||
initialize: ({@urls, @selected}) ->
|
||||
@maxResults = 10
|
||||
|
||||
@populateUrlList()
|
||||
@@ -34,8 +34,8 @@ class FileFinder extends Template
|
||||
|
||||
select: ->
|
||||
filePath = @findSelectedLi().text()
|
||||
atom.open filePath if filePath
|
||||
|
||||
@selected(filePath) if filePath and @selected
|
||||
@remove()
|
||||
|
||||
moveUp: ->
|
||||
@findSelectedLi()
|
||||
|
||||
@@ -6,7 +6,5 @@ class Project
|
||||
constructor: (@url) ->
|
||||
|
||||
getFilePaths: ->
|
||||
projectUrl = @url
|
||||
fs.async.listFiles(@url, true).pipe (urls) ->
|
||||
url.replace(projectUrl, "") for url in urls
|
||||
fs.async.listFiles(@url, true)
|
||||
|
||||
|
||||
@@ -33,11 +33,11 @@ class RootView extends Template
|
||||
toggleFileFinder: ->
|
||||
return unless @project
|
||||
|
||||
if @fileFinder
|
||||
if @fileFinder and @fileFinder.parent()[0]
|
||||
@fileFinder.remove()
|
||||
@fileFinder = null
|
||||
else
|
||||
@project.getFilePaths().done (urls) =>
|
||||
@fileFinder = FileFinder.build({urls})
|
||||
@fileFinder = FileFinder.build({urls, selected: (url) => @editor.open(url)})
|
||||
@addPane(@fileFinder)
|
||||
@fileFinder.input.focus()
|
||||
|
||||
Reference in New Issue
Block a user