This commit is contained in:
Corey Johnson
2012-02-06 10:37:37 -08:00
parent 3ef3933d06
commit 425e2b4f59
2 changed files with 6 additions and 2 deletions

View File

@@ -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", ->

View File

@@ -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 }