Add feature to display commands for vim mode (#10349)
Hans
created
Release Notes:
- Added the current operator stack to the Vim status bar at the bottom
of the editor. #4447
This commit introduces a new feature that displays the current partial
command in the vim mode, similar to the behavior in Vim plugin. This
helps users keep track of the commands they're entering.
@@ -517,6 +517,17 @@ impl Vim {
) {
self.start_recording(cx)
};
+ // Since these operations can only be entered with pre-operators,
+ // we need to clear the previous operators when pushing,
+ // so that the current stack is the most correct
+ if matches!(
+ operator,
+ Operator::AddSurrounds { .. }
+ | Operator::ChangeSurrounds { .. }
+ | Operator::DeleteSurrounds
+ ) {
+ self.clear_operator(cx);
+ };
self.update_state(|state| state.operator_stack.push(operator));
self.sync_vim_settings(cx);
}