mirror of
https://github.com/atom/atom.git
synced 2026-01-24 06:18:03 -05:00
WIP: trying to make preview faster
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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()
|
||||
|
||||
|
||||
@@ -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: ->
|
||||
|
||||
Reference in New Issue
Block a user