Don't throw exception if hitting meta-g with no previous relative address

This commit is contained in:
Nathan Sobo
2012-03-23 11:46:55 -06:00
parent 91bdc20b81
commit 0406746bd0
2 changed files with 4 additions and 2 deletions

View File

@@ -105,7 +105,9 @@ describe "CommandInterpreter", ->
expect(buffer.lineForRow(6)).toBe ' current < pivot ? left.push(current) : right.push(current);'
describe ".repeatRelativeAddress()", ->
it "repeats the last search command", ->
it "repeats the last search command if there is one", ->
interpreter.repeatRelativeAddress(editor) # don't raise an exception
editor.setCursorScreenPosition([4, 0])
interpreter.eval(editor, '/current')

View File

@@ -12,5 +12,5 @@ class CommandInterpreter
command.execute(editor)
repeatRelativeAddress: (editor) ->
@lastRelativeAddress.execute(editor)
@lastRelativeAddress?.execute(editor)