mirror of
https://github.com/atom/atom.git
synced 2026-01-22 21:38:10 -05:00
@@ -40,7 +40,7 @@ class CompositeCommand
|
||||
if bufferRanges.length and not currentCommand.preserveSelections
|
||||
editSession.setSelectedBufferRanges(bufferRanges, autoscroll: true)
|
||||
|
||||
operationsWillChangeBuffer = _.detect(operations, (operation) -> operation.newText)
|
||||
operationsWillChangeBuffer = _.detect(operations, (operation) -> operation.newText?)
|
||||
|
||||
if operationsWillChangeBuffer
|
||||
editSession.transact(executeOperations)
|
||||
|
||||
@@ -19,7 +19,7 @@ class Operation
|
||||
@getMarker().getRange()
|
||||
|
||||
execute: (editSession) ->
|
||||
@getBuffer().change(@getBufferRange(), @newText) if @newText
|
||||
@getBuffer().change(@getBufferRange(), @newText) if @newText?
|
||||
@getBufferRange() unless @preserveSelection
|
||||
|
||||
preview: ->
|
||||
|
||||
@@ -426,6 +426,12 @@ describe "CommandInterpreter", ->
|
||||
runs ->
|
||||
expect(buffer.lineForRow(6)).toBe '\t\t\tcurrent < pivot ? left.push(current) : right.push(current);'
|
||||
|
||||
it "removes matched text when an empty string is given as the replacement", ->
|
||||
waitsForPromise ->
|
||||
interpreter.eval('s/items//', editSession)
|
||||
runs ->
|
||||
expect(buffer.lineForRow(1)).toBe(' var sort = function() {')
|
||||
|
||||
describe "X x/regex/", ->
|
||||
it "returns selection operations for all regex matches in all the project's files", ->
|
||||
editSession.destroy()
|
||||
|
||||
Reference in New Issue
Block a user