diff --git a/spec/extensions/command-interpreter-spec.coffee b/spec/extensions/command-interpreter-spec.coffee index 9d6ef0da4..056ff4da6 100644 --- a/spec/extensions/command-interpreter-spec.coffee +++ b/spec/extensions/command-interpreter-spec.coffee @@ -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);' \ No newline at end of file diff --git a/src/extensions/command-interpreter/regex-address.coffee b/src/extensions/command-interpreter/regex-address.coffee index c3abefef5..efe27dcc1 100644 --- a/src/extensions/command-interpreter/regex-address.coffee +++ b/src/extensions/command-interpreter/regex-address.coffee @@ -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