mirror of
https://github.com/atom/atom.git
synced 2026-01-25 06:48:28 -05:00
Make dh keybinding work.
This commit is contained in:
@@ -57,6 +57,23 @@ describe "VimMode", ->
|
||||
expect(editor.buffer.getText()).toBe "12345\nABCDE"
|
||||
expect(editor.getPosition()).toEqual(column: 0, row: 1)
|
||||
|
||||
describe "when followed by an h", ->
|
||||
it "deletes the previous letter on the current line", ->
|
||||
editor.buffer.setText("abcd\n01234")
|
||||
editor.setPosition(column: 1, row: 1)
|
||||
|
||||
editor.trigger keydownEvent 'd'
|
||||
editor.trigger keydownEvent 'h'
|
||||
|
||||
expect(editor.buffer.getText()).toBe "abcd\n1234"
|
||||
expect(editor.getPosition()).toEqual {column: 0, row: 1}
|
||||
|
||||
editor.trigger keydownEvent 'd'
|
||||
editor.trigger keydownEvent 'h'
|
||||
|
||||
expect(editor.buffer.getText()).toBe "abcd\n1234"
|
||||
expect(editor.getPosition()).toEqual {column: 0, row: 1}
|
||||
|
||||
describe "when followed by a w", ->
|
||||
it "deletes to the beginning of the next word", ->
|
||||
editor.buffer.setText("abcd efg")
|
||||
|
||||
@@ -9,6 +9,11 @@ class MoveLeft extends Motion
|
||||
{column, row} = @editor.getPosition()
|
||||
@editor.moveLeft() if column > 0
|
||||
|
||||
select: ->
|
||||
position = @editor.getPosition()
|
||||
position.column-- if position.column > 0
|
||||
@editor.selectToPosition position
|
||||
|
||||
class MoveUp extends Motion
|
||||
execute: ->
|
||||
{column, row} = @editor.getPosition()
|
||||
|
||||
Reference in New Issue
Block a user