mirror of
https://github.com/atom/atom.git
synced 2026-01-24 14:28:14 -05:00
Start figuring out where the pieces go
This commit is contained in:
@@ -177,6 +177,7 @@ class Project
|
||||
for [column, length] in matchPositions
|
||||
range = new Range([row, column], [row, column + length])
|
||||
match = lineText.substr(column, length)
|
||||
console.log(path)
|
||||
iterator({path, range, match})
|
||||
|
||||
deferred = $.Deferred()
|
||||
|
||||
@@ -11,8 +11,8 @@ module.exports =
|
||||
class CommandPanelView extends View
|
||||
@content: ->
|
||||
@div class: 'command-panel tool-panel', =>
|
||||
@div class: 'loading is-loading', outlet: 'loadingMessage', 'Searching...'
|
||||
@div class: 'header', outlet: 'previewHeader', =>
|
||||
@span outlet: 'searchLoadingMessage', class: 'loading', 'Searching...'
|
||||
@ul outlet: 'expandCollapse', class: 'expand-collapse', =>
|
||||
@li class: 'expand', 'Expand All'
|
||||
@li class: 'collapse', 'Collapse All'
|
||||
@@ -53,7 +53,7 @@ class CommandPanelView extends View
|
||||
@previewList.hide()
|
||||
@previewHeader.hide()
|
||||
@errorMessages.hide()
|
||||
@loadingMessage.hide()
|
||||
@searchLoadingMessage.hide()
|
||||
@prompt.iconSize(@miniEditor.getFontSize())
|
||||
|
||||
@history = state.history ? []
|
||||
@@ -116,12 +116,13 @@ class CommandPanelView extends View
|
||||
@miniEditor.getText()
|
||||
|
||||
execute: (command=@escapedCommand()) ->
|
||||
@loadingMessage.show()
|
||||
@previewHeader.show()
|
||||
@searchLoadingMessage.show()
|
||||
@errorMessages.empty()
|
||||
|
||||
try
|
||||
@commandInterpreter.eval(command, rootView.getActivePaneItem()).done ({operationsToPreview, errorMessages}) =>
|
||||
@loadingMessage.hide()
|
||||
@searchLoadingMessage.hide()
|
||||
@history.push(command)
|
||||
@historyIndex = @history.length
|
||||
|
||||
@@ -131,8 +132,6 @@ class CommandPanelView extends View
|
||||
@errorMessages.append $$ ->
|
||||
@li errorMessage for errorMessage in errorMessages
|
||||
else if operationsToPreview?.length
|
||||
@previewHeader.show()
|
||||
@previewList.populate(operationsToPreview)
|
||||
@previewList.focus()
|
||||
@previewCount.text("#{_.pluralize(operationsToPreview.length, 'match', 'matches')} in #{_.pluralize(@previewList.getPathCount(), 'file')}").show()
|
||||
else
|
||||
|
||||
@@ -8,17 +8,21 @@ class SelectAllMatchesInProject extends Command
|
||||
previewOperations: true
|
||||
|
||||
constructor: (pattern) ->
|
||||
@regex = new RegExp(pattern, 'g')
|
||||
debugger;
|
||||
@regex = new RegExp(pattern)
|
||||
|
||||
compile: (project, buffer, range) ->
|
||||
deferred = $.Deferred()
|
||||
operations = []
|
||||
promise = project.scan @regex, ({path, range}) ->
|
||||
operations.push(new Operation(
|
||||
debugger;
|
||||
op = new Operation(
|
||||
project: project
|
||||
path: path
|
||||
bufferRange: range
|
||||
))
|
||||
)
|
||||
deferred.resolve([op])
|
||||
operations.push(op)
|
||||
|
||||
promise.done -> deferred.resolve(operations)
|
||||
promise.done# -> deferred.resolve(operations)
|
||||
deferred.promise()
|
||||
|
||||
@@ -39,7 +39,8 @@ class PreviewList extends ScrollView
|
||||
hasOperations: -> @operations?
|
||||
|
||||
populate: (operations) ->
|
||||
@destroyOperations() if @operations
|
||||
debugger;
|
||||
#@destroyOperations() if @operations
|
||||
@operations = operations
|
||||
@lastRenderedOperationIndex = 0
|
||||
@empty()
|
||||
|
||||
@@ -147,6 +147,7 @@ class FuzzyFinderView extends SelectList
|
||||
path.indexOf(options.filter) >= 0
|
||||
else
|
||||
@projectPaths
|
||||
console.log listedItems
|
||||
@setArray(listedItems)
|
||||
options.done(listedItems) if options.done?
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user