mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-11-11 04:48:44 +03:00
Add spec for global substitution in multiple selections
This commit is contained in:
parent
4abf41e173
commit
abff6cf387
@ -201,6 +201,15 @@ describe "CommandInterpreter", ->
|
||||
expect(buffer.lineForRow(6)).toBe '!!! current < pivot ? left.push(current) : right.push(current);'
|
||||
expect(buffer.lineForRow(12)).toBe '!!!};'
|
||||
|
||||
describe "when there are multiple selections", ->
|
||||
it "performs a multiple substitutions within each of the selections", ->
|
||||
editor.setSelectionBufferRange([[5, 0], [5, 20]])
|
||||
editor.addSelectionForBufferRange([[6, 0], [6, 44]])
|
||||
|
||||
interpreter.eval(editor, 's/current/foo/g')
|
||||
expect(buffer.lineForRow(5)).toBe ' foo = items.shift();'
|
||||
expect(buffer.lineForRow(6)).toBe ' foo < pivot ? left.push(foo) : right.push(current);'
|
||||
|
||||
describe ".repeatRelativeAddress()", ->
|
||||
it "repeats the last search command if there is one", ->
|
||||
interpreter.repeatRelativeAddress(editor) # don't raise an exception
|
||||
|
Loading…
Reference in New Issue
Block a user