From 425e2b4f59d4b692799539b5c4e62e1f847cbcf9 Mon Sep 17 00:00:00 2001 From: Corey Johnson Date: Mon, 6 Feb 2012 10:37:37 -0800 Subject: [PATCH] :lipstick: --- spec/atom/vim-mode-spec.coffee | 4 ++++ src/atom/vim-mode/commands.coffee | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/spec/atom/vim-mode-spec.coffee b/spec/atom/vim-mode-spec.coffee index 10514f014..98f4278f0 100644 --- a/spec/atom/vim-mode-spec.coffee +++ b/spec/atom/vim-mode-spec.coffee @@ -48,6 +48,10 @@ describe "VimMode", -> expect(editor.buffer.getText()).toBe '0123' expect(editor.getCursorPosition()).toEqual([0, 3]) + editor.trigger keydownEvent('x') + expect(editor.buffer.getText()).toBe '012' + expect(editor.getCursorPosition()).toEqual([0, 2]) + describe "the d keybinding", -> describe "when followed by a d", -> it "deletes the current line", -> diff --git a/src/atom/vim-mode/commands.coffee b/src/atom/vim-mode/commands.coffee index 2d4978df4..aafb6e2c2 100644 --- a/src/atom/vim-mode/commands.coffee +++ b/src/atom/vim-mode/commands.coffee @@ -5,8 +5,8 @@ class Command class DeleteRight extends Command execute: -> @editor.delete() - isOnLastCharachter = @editor.getCursorColumn() == @editor.getCurrentLine().length - if isOnLastCharachter + isOnEOL = @editor.getCursorColumn() == @editor.getCurrentLine().length + if isOnEOL @editor.setCursorColumn(@editor.getCursorColumn() - 1) module.exports = { DeleteRight }