mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
x command loops over all selected regions
This commit is contained in:
@@ -90,6 +90,20 @@ describe "CommandInterpreter", ->
|
||||
expect(selections[2].getBufferRange()).toEqual [[6,34], [6,41]]
|
||||
expect(selections[3].getBufferRange()).toEqual [[6,56], [6,63]]
|
||||
|
||||
it "loops through current selections and selects text matching the regex", ->
|
||||
editor.setSelectionBufferRange [[3,0], [3,62]]
|
||||
editor.addSelectionForBufferRange [[6,0], [6,65]]
|
||||
|
||||
interpreter.eval(editor, 'x/current')
|
||||
|
||||
selections = editor.getSelections()
|
||||
expect(selections.length).toBe 4
|
||||
|
||||
expect(selections[0].getBufferRange()).toEqual [[3,31], [3,38]]
|
||||
expect(selections[1].getBufferRange()).toEqual [[6,6], [6,13]]
|
||||
expect(selections[2].getBufferRange()).toEqual [[6,34], [6,41]]
|
||||
expect(selections[3].getBufferRange()).toEqual [[6,56], [6,63]]
|
||||
|
||||
describe "substitution", ->
|
||||
it "does nothing if there are no matches", ->
|
||||
editor.getSelection().setBufferRange([[6, 0], [6, 44]])
|
||||
|
||||
Reference in New Issue
Block a user