From fee48630034013a6761d76db15304a2f786a6014 Mon Sep 17 00:00:00 2001 From: johnfn Date: Wed, 8 Jun 2016 01:57:22 -0700 Subject: [PATCH] Add r. --- src/actions/actions.ts | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/actions/actions.ts b/src/actions/actions.ts index e9f48ab03b5..0547e258196 100644 --- a/src/actions/actions.ts +++ b/src/actions/actions.ts @@ -1006,7 +1006,6 @@ class ActionDeleteLastChar extends BaseCommand { } } - @RegisterAction class ActionJoin extends BaseCommand { modes = [ModeName.Normal]; @@ -1039,6 +1038,21 @@ class ActionJoin extends BaseCommand { } } +@RegisterAction +class ActionReplaceCharacter extends BaseCommand { + modes = [ModeName.Normal]; + keys = ["r", ""]; + + public async exec(position: Position, vimState: VimState): Promise { + const toReplace = vimState.actionState.actionKeys[1]; + const state = await new DeleteOperator().run(vimState, position, position); + + await TextEditor.insertAt(toReplace, position); + + return state; + } +} + @RegisterAction class MoveDD extends BaseMovement { modes = [ModeName.Normal];