Commands terminating in a substitution restore their initial selection

This commit is contained in:
Nathan Sobo
2012-07-02 19:35:14 -06:00
parent 81530761ba
commit 8fbbd77a23
6 changed files with 13 additions and 2 deletions

View File

@@ -239,6 +239,12 @@ describe "CommandInterpreter", ->
expect(buffer.lineForRow(5)).toBe ' foo = items.shift();'
expect(buffer.lineForRow(6)).toBe ' foo < pivot ? left.push(foo) : right.push(current);'
describe "when prefixed with an address", ->
it "restores the original selections upon completion if it is the last command", ->
editor.setSelectedBufferRanges([[[5, 0], [5, 20]], [[6, 0], [6, 44]]])
interpreter.eval(editor, ',s/current/foo/g')
expect(editor.getSelectedBufferRanges()).toEqual [[[5, 0], [5, 20]], [[6, 0], [6, 44]]]
describe "when command selects folded text", ->
it "unfolds lines that command selects", ->
editor.createFold(1, 9)