vim: Add support for temporary normal mode (ctrl-o) within insert mode (#19454)
Support has been added for the ctrl-o command within insert mode. Ctrl-o is used to partially enter normal mode for 1 motion to then return back into insert mode. Release Notes: - vim: Added support for `ctrl-o` in insert mode to enter temporary normal mode --------- Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
This commit is contained in:
parent
254ce74036
commit
b1cd9e4d24
14 changed files with 145 additions and 11 deletions
|
@ -185,6 +185,8 @@ impl Vim {
|
|||
error!("Unexpected normal mode motion operator: {:?}", operator)
|
||||
}
|
||||
}
|
||||
// Exit temporary normal mode (if active).
|
||||
self.exit_temporary_normal(cx);
|
||||
}
|
||||
|
||||
pub fn normal_object(&mut self, object: Object, cx: &mut ViewContext<Self>) {
|
||||
|
@ -483,6 +485,12 @@ impl Vim {
|
|||
});
|
||||
});
|
||||
}
|
||||
|
||||
fn exit_temporary_normal(&mut self, cx: &mut ViewContext<Self>) {
|
||||
if self.temp_mode {
|
||||
self.switch_mode(Mode::Insert, true, cx);
|
||||
}
|
||||
}
|
||||
}
|
||||
#[cfg(test)]
|
||||
mod test {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue