diff --git a/spec/atom/command-interpreter-spec.coffee b/spec/atom/command-interpreter-spec.coffee index 2fea4aab1..6e6ac415f 100644 --- a/spec/atom/command-interpreter-spec.coffee +++ b/spec/atom/command-interpreter-spec.coffee @@ -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') diff --git a/src/atom/command-interpreter.coffee b/src/atom/command-interpreter.coffee index 86ac82d48..4e412064f 100644 --- a/src/atom/command-interpreter.coffee +++ b/src/atom/command-interpreter.coffee @@ -12,5 +12,5 @@ class CommandInterpreter command.execute(editor) repeatRelativeAddress: (editor) -> - @lastRelativeAddress.execute(editor) + @lastRelativeAddress?.execute(editor)