Skip to content

Commit

Permalink
fixes #2760
Browse files Browse the repository at this point in the history
  • Loading branch information
xconverge committed Jun 24, 2018
1 parent c99bdb1 commit 815e39f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/actions/commands/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3007,7 +3007,6 @@ class CommandTabPrevious extends BaseTabCommand {
class ActionDeleteChar extends BaseCommand {
modes = [ModeName.Normal];
keys = ['x'];
runsOnceForEachCountPrefix = true;
canBeRepeatedWithDot = true;

public async exec(position: Position, vimState: VimState): Promise<VimState> {
Expand All @@ -3016,10 +3015,12 @@ class ActionDeleteChar extends BaseCommand {
return vimState;
}

let timesToRepeat = vimState.recordedState.count || 1;

const state = await new operator.DeleteOperator(this.multicursorIndex).run(
vimState,
position,
position
position.getRightByCount(timesToRepeat - 1)
);

state.currentMode = ModeName.Normal;
Expand Down
7 changes: 7 additions & 0 deletions test/mode/normalModeTests/commands.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ suite('Mode Normal', () => {
end: ['t|e'],
});

newTest({
title: "Can handle 'Nx' and paste",
start: ['t|ext'],
keysPressed: '2xo<Esc>p',
end: ['tt', 'e|x'],
});

newTest({
title: "Can handle 'x' at end of line",
start: ['one tw|o'],
Expand Down

0 comments on commit 815e39f

Please sign in to comment.