mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-14 22:14:23 +00:00
Allow binding to motions in insert mode (#15308)
Release Notes: - vim: Allow binding motions in insert mode
This commit is contained in:
parent
bde02a350e
commit
be86852f95
1 changed files with 1 additions and 4 deletions
|
@ -436,7 +436,7 @@ pub(crate) fn motion(motion: Motion, cx: &mut WindowContext) {
|
||||||
let active_operator = Vim::read(cx).active_operator();
|
let active_operator = Vim::read(cx).active_operator();
|
||||||
let mut waiting_operator: Option<Operator> = None;
|
let mut waiting_operator: Option<Operator> = None;
|
||||||
match Vim::read(cx).state().mode {
|
match Vim::read(cx).state().mode {
|
||||||
Mode::Normal | Mode::Replace => {
|
Mode::Normal | Mode::Replace | Mode::Insert => {
|
||||||
if active_operator == Some(Operator::AddSurrounds { target: None }) {
|
if active_operator == Some(Operator::AddSurrounds { target: None }) {
|
||||||
waiting_operator = Some(Operator::AddSurrounds {
|
waiting_operator = Some(Operator::AddSurrounds {
|
||||||
target: Some(SurroundsType::Motion(motion)),
|
target: Some(SurroundsType::Motion(motion)),
|
||||||
|
@ -448,9 +448,6 @@ pub(crate) fn motion(motion: Motion, cx: &mut WindowContext) {
|
||||||
Mode::Visual | Mode::VisualLine | Mode::VisualBlock => {
|
Mode::Visual | Mode::VisualLine | Mode::VisualBlock => {
|
||||||
visual_motion(motion.clone(), count, cx)
|
visual_motion(motion.clone(), count, cx)
|
||||||
}
|
}
|
||||||
Mode::Insert => {
|
|
||||||
// Shouldn't execute a motion in insert mode. Ignoring
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
Vim::update(cx, |vim, cx| {
|
Vim::update(cx, |vim, cx| {
|
||||||
vim.clear_operator(cx);
|
vim.clear_operator(cx);
|
||||||
|
|
Loading…
Reference in a new issue