mirror of
https://github.com/atom/atom.git
synced 2026-02-16 01:25:13 -05:00
Stash filestream work
This commit is contained in:
@@ -177,7 +177,7 @@ class Project
|
||||
for [column, length] in matchPositions
|
||||
range = new Range([row, column], [row, column + length])
|
||||
match = lineText.substr(column + 1, length)
|
||||
iterator({path, range, match})
|
||||
iterator({path, range, match, lineText})
|
||||
|
||||
deferred = $.Deferred()
|
||||
exit = (code) ->
|
||||
|
||||
@@ -13,11 +13,12 @@ class SelectAllMatchesInProject extends Command
|
||||
compile: (project, buffer, range) ->
|
||||
deferred = $.Deferred()
|
||||
operations = []
|
||||
promise = project.scan @regex, ({path, range}) ->
|
||||
promise = project.scan @regex, ({path, range, match, lineText}) ->
|
||||
op = new Operation(
|
||||
project: project
|
||||
path: path
|
||||
bufferRange: range
|
||||
lineText: lineText
|
||||
)
|
||||
project.previewList.populateSingle(op)
|
||||
operations.push(op)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
module.exports =
|
||||
class Operation
|
||||
constructor: ({@project, @path, @buffer, @bufferRange, @newText, @preserveSelection, @errorMessage}) ->
|
||||
constructor: ({@project, @path, @buffer, @bufferRange, @lineText, @newText, @preserveSelection, @errorMessage}) ->
|
||||
if @buffer?
|
||||
@buffer.retain()
|
||||
@getMarker()
|
||||
@@ -23,11 +23,10 @@ class Operation
|
||||
@getBufferRange() unless @preserveSelection
|
||||
|
||||
preview: ->
|
||||
range = @getBuffer().getMarkerRange(@getMarker())
|
||||
line = @getBuffer().lineForRow(range.start.row)
|
||||
prefix = line[0...range.start.column]
|
||||
match = line[range.start.column...range.end.column]
|
||||
suffix = line[range.end.column..]
|
||||
range = @bufferRange
|
||||
prefix = @lineText[0...range.start.column]
|
||||
match = @lineText[range.start.column + 1...range.end.column]
|
||||
suffix = @lineText[range.end.column..]
|
||||
|
||||
{prefix, suffix, match, range}
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
$ = require 'jquery'
|
||||
ScrollView = require 'scroll-view'
|
||||
_ = require 'underscore'
|
||||
fs = require 'fs-utils'
|
||||
PathView = require './path-view'
|
||||
OperationView = require './operation-view'
|
||||
|
||||
@@ -73,7 +72,6 @@ class PreviewList extends ScrollView
|
||||
pathView = @pathViewForPath(operation.getPath())
|
||||
pathView.addOperation(operation)
|
||||
|
||||
|
||||
pathViewForPath: (path) ->
|
||||
pathView = @viewsForPath[path]
|
||||
if not pathView
|
||||
|
||||
Reference in New Issue
Block a user