Add basic support for visual marks < and >

Only works with range '<,'>. If there are multiple selections, run the
command for each one.

Closes #31.
This commit is contained in:
jazzpi 2016-08-15 21:13:32 +02:00
parent 3a104fe061
commit 1b8f6238c2
5 changed files with 84 additions and 27 deletions

View file

@ -70,6 +70,7 @@ describe "the input element", ->
expect(getVisibility()).toBe true
commandEditor = getCommandEditor()
model = commandEditor.getModel()
expect(model.getText()).toBe ''
model.setText('abc')
atom.commands.dispatch(commandEditor, "core:backspace")
expect(getVisibility()).toBe true
@ -82,3 +83,11 @@ describe "the input element", ->
expect(model.getText()).toBe ''
atom.commands.dispatch(commandEditor, "core:backspace")
expect(getVisibility()).toBe false
it "contains '<,'> when opened while there are selections", ->
editor.setCursorBufferPosition([0, 0])
editor.selectToBufferPosition([0, 1])
editor.addCursorAtBufferPosition([2, 0])
editor.selectToBufferPosition([2, 1])
atom.commands.dispatch(editorElement, "ex-mode:open")
expect(getCommandEditor().getModel().getText()).toBe "'<,'>"