mirror of
https://github.com/atom/atom.git
synced 2026-01-24 14:28:14 -05:00
Update search in reverse test on command interpreter spec
This commit is contained in:
@@ -106,7 +106,7 @@ describe "CommandInterpreter", ->
|
||||
expect(editor.getSelection().getBufferRange()).toEqual [[3,8], [3,13]]
|
||||
|
||||
it "searches in reverse when prefixed with a -", ->
|
||||
editor.setSelectedBufferRange([[5, 0], [5,1]])
|
||||
editor.setSelectedBufferRange([[6, 16], [6, 22]])
|
||||
interpreter.eval(editor, '-/pivot')
|
||||
expect(editor.getSelection().getBufferRange()).toEqual [[3,8], [3,13]]
|
||||
|
||||
@@ -232,4 +232,4 @@ describe "CommandInterpreter", ->
|
||||
|
||||
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);'
|
||||
expect(buffer.lineForRow(6)).toBe ' foo < pivot ? left.push(foo) : right.push(current);'
|
||||
@@ -11,7 +11,7 @@ class RegexAddress extends Address
|
||||
@regex = new RegExp(pattern)
|
||||
|
||||
getRange: (editor, currentRange) ->
|
||||
rangeBefore = new Range([0, 0], currentRange.end)
|
||||
rangeBefore = new Range([0, 0], currentRange.start)
|
||||
rangeAfter = new Range(currentRange.end, editor.getEofPosition())
|
||||
|
||||
rangeToSearch = if @reverse then rangeBefore else rangeAfter
|
||||
|
||||
Reference in New Issue
Block a user