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 lib/operators/put-operator.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ class Put extends Operator
@editor.setCursorScreenPosition(originalPosition)
@editor.moveToFirstCharacterOfLine()

@vimState.activateNormalMode()
if type isnt 'linewise'
@editor.moveLeft()
@vimState.activateNormalMode()

# Private: Helper to determine if the editor is currently on the last row.
#
Expand Down
9 changes: 9 additions & 0 deletions spec/operators-spec.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -947,6 +947,15 @@ describe "Operators", ->
expect(editor.getText()).toBe "034512\n"
expect(editor.getCursorScreenPosition()).toEqual [0, 3]

describe "at the end of a line", ->
beforeEach ->
editor.setCursorScreenPosition [0, 2]
keydown('p')

it "positions cursor correctly", ->
expect(editor.getText()).toBe "012345\n"
expect(editor.getCursorScreenPosition()).toEqual [0, 5]

describe "when useClipboardAsDefaultRegister enabled", ->
it "inserts contents from clipboard", ->
atom.config.set 'vim-mode.useClipboardAsDefaultRegister', true
Expand Down