Skip to content

Commit

Permalink
Merge pull request #706 from gwenn/vi_dot
Browse files Browse the repository at this point in the history
Fix dot command in vi mode
  • Loading branch information
gwenn authored Jun 23, 2023
2 parents 97df240 + b6323b8 commit c2383ec
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
4 changes: 3 additions & 1 deletion src/keymap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -711,7 +711,9 @@ impl<'b> InputState<'b> {
E(K::Char('$') | K::End, M::NONE) => Cmd::Move(Movement::EndOfLine),
E(K::Char('.'), M::NONE) => {
// vi-redo (repeat last command)
if no_num_args {
if !self.last_cmd.is_repeatable() {
Cmd::Noop
} else if no_num_args {
self.last_cmd.redo(None, wrt)
} else {
self.last_cmd.redo(Some(n), wrt)
Expand Down
11 changes: 8 additions & 3 deletions src/test/vi_cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,15 @@ fn dollar() {
);
}

/*#[test]
#[test]
fn dot() {
// TODO
}*/
assert_cursor(
EditMode::Vi,
("", ""),
&[E::ESC, E::from('.'), E::ENTER],
("", ""),
);
}

#[test]
fn semi_colon() {
Expand Down

0 comments on commit c2383ec

Please sign in to comment.