Add repeat-relative-address-in-reverse event to command panel

This commit is contained in:
Corey Johnson & Nathan Sobo
2012-06-14 11:01:28 -07:00
parent 4adffdc9f3
commit 6b5a52ae5c
5 changed files with 25 additions and 1 deletions

View File

@@ -47,7 +47,7 @@ describe "CommandPanel", ->
expect(commandPanel.miniEditor.getCursorScreenPosition()).toEqual [0, 0]
describe "when command-panel:repeat-relative-address is triggered on the root view", ->
it "calls .repeatRelativeAddress on the command interpreter with the active editor", ->
it "repeats the last search command if there is one", ->
rootView.trigger 'command-panel:repeat-relative-address'
editor.setCursorScreenPosition([4, 0])
@@ -69,6 +69,18 @@ describe "CommandPanel", ->
rootView.trigger 'command-panel:repeat-relative-address'
expect(editor.getSelection().getBufferRange()).toEqual [[3,31], [3,38]]
describe "when command-pane:repeat-relative-address-in-reverse is triggered on the root view", ->
it "it repeats the last relative address in the reverse direction", ->
rootView.trigger 'command-panel:repeat-relative-address-in-reverse'
editor.setCursorScreenPosition([6, 0])
commandPanel.execute("/current")
expect(editor.getSelection().getBufferRange()).toEqual [[6,6], [6,13]]
rootView.trigger 'command-panel:repeat-relative-address-in-reverse'
expect(editor.getSelection().getBufferRange()).toEqual [[5,6], [5,13]]
describe "when command-panel:set-selection-as-regex-address is triggered on the root view", ->
it "sets the @lastRelativeAddress to a RegexAddress of the current selection", ->
rootView.open(require.resolve('fixtures/sample.js'))