Add feature to display commands for vim mode (#10349)
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.
This commit is contained in:
parent
98533079e4
commit
f2d61f3ea5
2 changed files with 24 additions and 1 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue