Skip to content
This repository was archived by the owner on Apr 6, 2018. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/operators.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* `c2c` - repeated linewise
* `C` - change to the end of the line
* [Adding and subtracting](http://vimhelp.appspot.com/change.txt.html#CTRL-A)
* `ctrl-a` and `ctrl-x` in command mode to increase/decrease numbers in text
* `ctrl-a` and `ctrl-x` in normal mode to increase/decrease numbers in text
* [Yank](http://vimhelp.appspot.com/change.txt.html#yank)
* `vwy` - works in visual mode
* `yw` - with a motion
Expand Down
42 changes: 21 additions & 21 deletions spec/motions-spec.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ describe "Motions", ->
editor.normalModeInputView.editorElement.getModel().setText(key)

submitNormalModeInputText = (text) ->
commandEditor = editor.normalModeInputView.editorElement
commandEditor.getModel().setText(text)
atom.commands.dispatch(commandEditor, "core:confirm")
inputEditor = editor.normalModeInputView.editorElement
inputEditor.getModel().setText(text)
atom.commands.dispatch(inputEditor, "core:confirm")

describe "simple motions", ->
beforeEach ->
Expand Down Expand Up @@ -850,7 +850,7 @@ describe "Motions", ->
editor.setCursorScreenPosition([0, 2])

describe "as a motion", ->
describe "in command mode", ->
describe "in normal mode", ->
beforeEach ->
keydown('g')
keydown('g')
Expand Down Expand Up @@ -885,7 +885,7 @@ describe "Motions", ->
expect(editor.getCursorScreenPosition()).toEqual [0, 1]

describe "as a repeated motion", ->
describe "in command mode", ->
describe "in normal mode", ->
beforeEach ->
keydown('2')
keydown('g')
Expand Down Expand Up @@ -1189,7 +1189,7 @@ describe "Motions", ->
expect(editor.getCursorBufferPosition()).toEqual [1, 0]

describe "using search history", ->
commandEditor = null
inputEditor = null

beforeEach ->
keydown('/')
Expand All @@ -1200,27 +1200,27 @@ describe "Motions", ->
submitNormalModeInputText('abc')
expect(editor.getCursorBufferPosition()).toEqual [2, 0]

commandEditor = editor.normalModeInputView.editorElement
inputEditor = editor.normalModeInputView.editorElement

it "allows searching history in the search field", ->
keydown('/')
atom.commands.dispatch(commandEditor, 'core:move-up')
expect(commandEditor.getModel().getText()).toEqual('abc')
atom.commands.dispatch(commandEditor, 'core:move-up')
expect(commandEditor.getModel().getText()).toEqual('def')
atom.commands.dispatch(commandEditor, 'core:move-up')
expect(commandEditor.getModel().getText()).toEqual('def')
atom.commands.dispatch(inputEditor, 'core:move-up')
expect(inputEditor.getModel().getText()).toEqual('abc')
atom.commands.dispatch(inputEditor, 'core:move-up')
expect(inputEditor.getModel().getText()).toEqual('def')
atom.commands.dispatch(inputEditor, 'core:move-up')
expect(inputEditor.getModel().getText()).toEqual('def')

it "resets the search field to empty when scrolling back", ->
keydown('/')
atom.commands.dispatch(commandEditor, 'core:move-up')
expect(commandEditor.getModel().getText()).toEqual('abc')
atom.commands.dispatch(commandEditor, 'core:move-up')
expect(commandEditor.getModel().getText()).toEqual('def')
atom.commands.dispatch(commandEditor, 'core:move-down')
expect(commandEditor.getModel().getText()).toEqual('abc')
atom.commands.dispatch(commandEditor, 'core:move-down')
expect(commandEditor.getModel().getText()).toEqual ''
atom.commands.dispatch(inputEditor, 'core:move-up')
expect(inputEditor.getModel().getText()).toEqual('abc')
atom.commands.dispatch(inputEditor, 'core:move-up')
expect(inputEditor.getModel().getText()).toEqual('def')
atom.commands.dispatch(inputEditor, 'core:move-down')
expect(inputEditor.getModel().getText()).toEqual('abc')
atom.commands.dispatch(inputEditor, 'core:move-down')
expect(inputEditor.getModel().getText()).toEqual ''

describe "the * keybinding", ->
beforeEach ->
Expand Down
10 changes: 5 additions & 5 deletions spec/vim-state-spec.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -198,14 +198,14 @@ describe "VimState", ->
it "allows the cursor to be placed on the \n character", ->
expect(editor.getCursorScreenPosition()).toEqual [0, 6]

it "puts the editor into command mode when <escape> is pressed", ->
it "puts the editor into normal mode when <escape> is pressed", ->
keydown('escape')

expect(editorElement.classList.contains('normal-mode')).toBe(true)
expect(editorElement.classList.contains('insert-mode')).toBe(false)
expect(editorElement.classList.contains('visual-mode')).toBe(false)

it "puts the editor into command mode when <ctrl-c> is pressed", ->
it "puts the editor into normal mode when <ctrl-c> is pressed", ->
helpers.mockPlatform(editorElement, 'platform-darwin')
keydown('c', ctrl: true)
helpers.unmockPlatform(editorElement)
Expand All @@ -224,14 +224,14 @@ describe "VimState", ->
expect(editor.getSelectedBufferRanges()).toEqual [[[0, 4], [0, 5]]]
expect(editor.getSelectedText()).toBe("t")

it "puts the editor into command mode when <escape> is pressed", ->
it "puts the editor into normal mode when <escape> is pressed", ->
keydown('escape')

expect(editor.getCursorBufferPositions()).toEqual [[0, 4]]
expect(editorElement.classList.contains('normal-mode')).toBe(true)
expect(editorElement.classList.contains('visual-mode')).toBe(false)

it "puts the editor into command mode when <escape> is pressed on selection is reversed", ->
it "puts the editor into normal mode when <escape> is pressed on selection is reversed", ->
expect(editor.getSelectedText()).toBe("t")
keydown("h")
keydown("h")
Expand Down Expand Up @@ -308,7 +308,7 @@ describe "VimState", ->
expect(vimState.mode).toEqual 'normal'
expect(editorElement.classList.contains('normal-mode')).toBe(true)

it "activateVisualMode with same type puts the editor into command mode", ->
it "activateVisualMode with same type puts the editor into normal mode", ->
keydown('v')
expect(editorElement.classList.contains('visual-mode')).toBe(true)
expect(vimState.submode).toEqual 'characterwise'
Expand Down