mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-09-20 15:37:46 +03:00
Update search in reverse test on command interpreter spec
This commit is contained in:
parent
b6f9801a19
commit
bc3f9543be
@ -106,7 +106,7 @@ describe "CommandInterpreter", ->
|
|||||||
expect(editor.getSelection().getBufferRange()).toEqual [[3,8], [3,13]]
|
expect(editor.getSelection().getBufferRange()).toEqual [[3,8], [3,13]]
|
||||||
|
|
||||||
it "searches in reverse when prefixed with a -", ->
|
it "searches in reverse when prefixed with a -", ->
|
||||||
editor.setSelectedBufferRange([[5, 0], [5,1]])
|
editor.setSelectedBufferRange([[6, 16], [6, 22]])
|
||||||
interpreter.eval(editor, '-/pivot')
|
interpreter.eval(editor, '-/pivot')
|
||||||
expect(editor.getSelection().getBufferRange()).toEqual [[3,8], [3,13]]
|
expect(editor.getSelection().getBufferRange()).toEqual [[3,8], [3,13]]
|
||||||
|
|
||||||
@ -232,4 +232,4 @@ describe "CommandInterpreter", ->
|
|||||||
|
|
||||||
interpreter.eval(editor, 's/current/foo/g')
|
interpreter.eval(editor, 's/current/foo/g')
|
||||||
expect(buffer.lineForRow(5)).toBe ' foo = items.shift();'
|
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)
|
@regex = new RegExp(pattern)
|
||||||
|
|
||||||
getRange: (editor, currentRange) ->
|
getRange: (editor, currentRange) ->
|
||||||
rangeBefore = new Range([0, 0], currentRange.end)
|
rangeBefore = new Range([0, 0], currentRange.start)
|
||||||
rangeAfter = new Range(currentRange.end, editor.getEofPosition())
|
rangeAfter = new Range(currentRange.end, editor.getEofPosition())
|
||||||
|
|
||||||
rangeToSearch = if @reverse then rangeBefore else rangeAfter
|
rangeToSearch = if @reverse then rangeBefore else rangeAfter
|
||||||
|
Loading…
Reference in New Issue
Block a user