Remove streaming changes

This commit is contained in:
Garen Torikian
2013-03-31 00:30:39 -07:00
parent 7f8e2aba1b
commit ea65421120
3 changed files with 8 additions and 23 deletions

View File

@@ -129,7 +129,6 @@ class CommandPanelView extends View
@previewHeader.show()
@searchLoadingMessage.show()
@errorMessages.empty()
project.previewList = @previewList
try
@commandInterpreter.eval(command, rootView.getActivePaneItem()).done ({operationsToPreview, errorMessages}) =>
@@ -144,9 +143,9 @@ class CommandPanelView extends View
@errorMessages.append $$ ->
@li errorMessage for errorMessage in errorMessages
else if operationsToPreview?.length
@previewList.show()
@previewList.populate(operationsToPreview)
@previewList.focus()
@previewCount.text("#{_.pluralize(operationsToPreview.length, 'match', 'matches')} in #{_.pluralize(@previewList.getPathCount(operationsToPreview), 'file')}").show()
@previewCount.text("#{_.pluralize(operationsToPreview.length, 'match', 'matches')} in #{_.pluralize(@previewList.getPathCount(), 'file')}").show()
else
@detach()
catch error

View File

@@ -14,14 +14,12 @@ class SelectAllMatchesInProject extends Command
deferred = $.Deferred()
operations = []
promise = project.scan @regex, ({path, range, match, lineText}) ->
op = new Operation(
operations.push(new Operation(
project: project
path: path
bufferRange: range
lineText: lineText
)
project.previewList.populateSingle(op)
operations.push(op)
promise.done -> deferred.resolve(operations)
deferred.promise()

View File

@@ -19,7 +19,8 @@ class PreviewList extends ScrollView
@on 'core:move-down', => @selectNextOperation(); false
@on 'core:move-up', => @selectPreviousOperation(); false
@on 'scroll', =>
@renderOperations() if @scrollBottom() >= (@prop('scrollHeight'))
@command 'command-panel:collapse-all', => @collapseAllPaths()
@command 'command-panel:expand-all', => @expandAllPaths()
@@ -27,6 +28,7 @@ class PreviewList extends ScrollView
@children().each (index, element) -> $(element).view().expand()
collapseAllPaths: ->
@renderOperations(renderAll: true)
@children().each (index, element) -> $(element).view().collapse()
destroy: ->
@@ -46,14 +48,6 @@ class PreviewList extends ScrollView
@find('.operation:first').addClass('selected')
populateSingle: (operation) ->
@viewsForPath ||= {}
@lastRenderedOperationIndex ||= 0
@renderOperation(operation)
@find('.operation:first').addClass('selected')
renderOperations: ({renderAll}={}) ->
renderAll ?= false
startingScrollHeight = @prop('scrollHeight')
@@ -62,12 +56,6 @@ class PreviewList extends ScrollView
pathView.addOperation(operation)
@lastRenderedOperationIndex++
break if not renderAll and @prop('scrollHeight') >= startingScrollHeight + @pixelOverdraw and @prop('scrollHeight') > @height() + @pixelOverdraw
renderOperation: (operation) ->
startingScrollHeight = @prop('scrollHeight')
pathView = @pathViewForPath(operation.getPath())
pathView.addOperation(operation)
@lastRenderedOperationIndex++
pathViewForPath: (path) ->
pathView = @viewsForPath[path]
@@ -106,8 +94,8 @@ class PreviewList extends ScrollView
previousView.addClass('selected')
previousView.scrollTo()
getPathCount: (operations=@operations)->
_.keys(_.groupBy(operations, (operation) -> operation.getPath())).length
getPathCount: ->
_.keys(_.groupBy(@operations, (operation) -> operation.getPath())).length
getOperations: ->
new Array(@operations...)