diff --git a/src/edit_mode/vi/command.rs b/src/edit_mode/vi/command.rs index e7bf0426..9c4f0711 100644 --- a/src/edit_mode/vi/command.rs +++ b/src/edit_mode/vi/command.rs @@ -212,10 +212,10 @@ impl Command { }, Self::Change => { let op = match motion { - Motion::End => Some(vec![ReedlineOption::Edit(EditCommand::ClearToLineEnd)]), + Motion::End => Some(vec![ReedlineOption::Edit(EditCommand::CutToLineEnd)]), Motion::Line => Some(vec![ - ReedlineOption::Edit(EditCommand::MoveToStart { select: false }), - ReedlineOption::Edit(EditCommand::ClearToLineEnd), + ReedlineOption::Edit(EditCommand::MoveToLineStart { select: false }), + ReedlineOption::Edit(EditCommand::CutToLineEnd), ]), Motion::NextWord => Some(vec![ReedlineOption::Edit(EditCommand::CutWordRight)]), Motion::NextBigWord => { diff --git a/src/edit_mode/vi/parser.rs b/src/edit_mode/vi/parser.rs index 81d0e396..5d554ce8 100644 --- a/src/edit_mode/vi/parser.rs +++ b/src/edit_mode/vi/parser.rs @@ -511,8 +511,7 @@ mod tests { #[case(&['d', 'b'], ReedlineEvent::Multiple(vec![ReedlineEvent::Edit(vec![EditCommand::CutWordLeft])]))] #[case(&['d', 'B'], ReedlineEvent::Multiple(vec![ReedlineEvent::Edit(vec![EditCommand::CutBigWordLeft])]))] #[case(&['c', 'c'], ReedlineEvent::Multiple(vec![ - //ReedlineEvent::Edit(vec![EditCommand::CutCurrentLine]), ReedlineEvent::Repaint]))] - ReedlineEvent::Edit(vec![EditCommand::MoveToStart{select: false}]), ReedlineEvent::Edit(vec![EditCommand::ClearToLineEnd]), ReedlineEvent::Repaint]))] + ReedlineEvent::Edit(vec![EditCommand::MoveToLineStart { select: false }]), ReedlineEvent::Edit(vec![EditCommand::CutToLineEnd]), ReedlineEvent::Repaint]))] #[case(&['c', 'w'], ReedlineEvent::Multiple(vec![ReedlineEvent::Edit(vec![EditCommand::CutWordRight]), ReedlineEvent::Repaint]))] #[case(&['c', 'W'], ReedlineEvent::Multiple(vec![ReedlineEvent::Edit(vec![EditCommand::CutBigWordRight]), ReedlineEvent::Repaint]))] #[case(&['c', 'e'], ReedlineEvent::Multiple(vec![ReedlineEvent::Edit(vec![EditCommand::CutWordRight]), ReedlineEvent::Repaint]))]