diff --git a/src/app/project.coffee b/src/app/project.coffee index 733929605..918de78e6 100644 --- a/src/app/project.coffee +++ b/src/app/project.coffee @@ -140,7 +140,9 @@ class Project regex = new RegExp(regex.source, 'g') command = "#{require.resolve('ack')} --all --match \"#{regex.source}\" \"#{@getPath()}\"" bufferedData = "" - ChildProcess.exec command , bufferLines: true, stdout: (data) -> + + console.log command + promise = ChildProcess.exec command , bufferLines: true, stdout: (data) -> bufferedData += data currentIndex = 0 while currentIndex < bufferedData.length @@ -161,4 +163,7 @@ class Project bufferedData = bufferedData.substring(currentIndex) + promise.done -> console.log "DONE" + + _.extend Project.prototype, EventEmitter diff --git a/src/app/window.coffee b/src/app/window.coffee index 35382f5a0..93f748833 100644 --- a/src/app/window.coffee +++ b/src/app/window.coffee @@ -83,6 +83,12 @@ windowAdditions = onerror: -> $native.showDevTools() + measure: (description, fn) -> + start = new Date().getTime() + fn() + result = new Date().getTime() - start + console.log description, result + window[key] = value for key, value of windowAdditions window.setUpKeymap() diff --git a/src/extensions/command-panel/command-panel.coffee b/src/extensions/command-panel/command-panel.coffee index 1f0967ec1..9a7d0f30a 100644 --- a/src/extensions/command-panel/command-panel.coffee +++ b/src/extensions/command-panel/command-panel.coffee @@ -1,4 +1,4 @@ -{View} = require 'space-pen' +{View, $$$} = require 'space-pen' CommandInterpreter = require 'command-panel/command-interpreter' RegexAddress = require 'command-panel/commands/regex-address' CompositeCommand = require 'command-panel/commands/composite-command' @@ -90,8 +90,16 @@ class CommandPanel extends View populatePreviewList: (operations) -> @previewedOperations = operations @previewList.empty() - for operation in operations - @previewList.append(new PreviewItem(operation)) + @previewList.html $$$ -> + for operation in operations + {prefix, suffix, match} = operation.preview() + @li => + @span operation.getPath(), outlet: "path", class: "path" + @span outlet: "preview", class: "preview", => + @span prefix + @span match, class: 'match' + @span suffix + @previewList.show() navigateBackwardInHistory: ->