Skip to content

Commit

Permalink
Merge pull request #252 from VSCodeVim/replace
Browse files Browse the repository at this point in the history
Add r.
  • Loading branch information
johnfn committed Jun 8, 2016
2 parents 2e58918 + fee4863 commit a14b6ae
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/actions/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1006,7 +1006,6 @@ class ActionDeleteLastChar extends BaseCommand {
}
}


@RegisterAction
class ActionJoin extends BaseCommand {
modes = [ModeName.Normal];
Expand Down Expand Up @@ -1039,6 +1038,21 @@ class ActionJoin extends BaseCommand {
}
}

@RegisterAction
class ActionReplaceCharacter extends BaseCommand {
modes = [ModeName.Normal];
keys = ["r", "<character>"];

public async exec(position: Position, vimState: VimState): Promise<VimState> {
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];
Expand Down

0 comments on commit a14b6ae

Please sign in to comment.