mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-11-11 04:48:44 +03:00
Don't reuse buffer paths as project paths
This commit is contained in:
parent
9dbf07d81e
commit
57e45883bb
@ -209,3 +209,22 @@ describe 'FuzzyFinder', ->
|
||||
|
||||
runs ->
|
||||
expect(rootView.project.getFilePaths).not.toHaveBeenCalled()
|
||||
|
||||
it "doesn't cache buffer paths", ->
|
||||
spyOn(rootView.project, "getFilePaths").andCallThrough()
|
||||
rootView.trigger 'fuzzy-finder:toggle-buffer-finder'
|
||||
|
||||
waitsFor ->
|
||||
finder.list.children('li').length > 0
|
||||
|
||||
runs ->
|
||||
expect(rootView.project.getFilePaths).not.toHaveBeenCalled()
|
||||
rootView.project.getFilePaths.reset()
|
||||
rootView.trigger 'fuzzy-finder:toggle-buffer-finder'
|
||||
rootView.trigger 'fuzzy-finder:toggle-file-finder'
|
||||
|
||||
waitsFor ->
|
||||
finder.list.children('li').length > 0
|
||||
|
||||
runs ->
|
||||
expect(rootView.project.getFilePaths).toHaveBeenCalled()
|
||||
|
@ -18,6 +18,7 @@ class FuzzyFinder extends SelectList
|
||||
|
||||
allowActiveEditorChange: null
|
||||
maxItems: 10
|
||||
projectPaths: null
|
||||
|
||||
initialize: (@rootView) ->
|
||||
super
|
||||
@ -53,11 +54,12 @@ class FuzzyFinder extends SelectList
|
||||
@attach() if @paths?.length
|
||||
|
||||
populateProjectPaths: ->
|
||||
if @array?.length > 0
|
||||
@setArray(@array)
|
||||
if @projectPaths?.length > 0
|
||||
@setArray(@projectPaths)
|
||||
else
|
||||
@setLoading("Indexing...")
|
||||
@rootView.project.getFilePaths().done (paths) =>
|
||||
@projectPaths = paths
|
||||
@setArray(paths)
|
||||
|
||||
populateOpenBufferPaths: ->
|
||||
|
Loading…
Reference in New Issue
Block a user