Skip to content

Commit

Permalink
Add r.
Browse files Browse the repository at this point in the history
  • Loading branch information
johnfn committed Jun 8, 2016
1 parent 2e58918 commit fee4863
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 fee4863

Please sign in to comment.