mirror of
https://github.com/neovim/neovim.git
synced 2025-09-18 17:28:23 +00:00
main: Call normal_execute
from normal_enter
`normal_prepare` is now called by `normal_check` before returning 1(to continue). Also remove `input_{enable,disable}_events` calls from `normal_cmd`, which only exists now as a compatibility function to run normal commands with keys inserted into the typeahead buffer(We don't want to process events in these cases anyway).
This commit is contained in:
@@ -463,7 +463,13 @@ void normal_enter(bool cmdwin, bool noexmode)
|
|||||||
} else if (check_result == -1) {
|
} else if (check_result == -1) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
normal_cmd(&state.oa, true);
|
|
||||||
|
input_enable_events();
|
||||||
|
int c = safe_vgetc();
|
||||||
|
input_disable_events();
|
||||||
|
if (!normal_execute(&state, c)) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1271,7 +1277,13 @@ static int normal_check(NormalState *s)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
return !s->cmdwin || cmdwin_result == 0;
|
if (s->cmdwin && cmdwin_result != 0) {
|
||||||
|
// command-line window and cmdwin_result is set
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
normal_prepare(s);
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -7589,9 +7601,6 @@ void normal_cmd(oparg_T *oap, bool toplevel)
|
|||||||
s.toplevel = toplevel;
|
s.toplevel = toplevel;
|
||||||
s.oa = *oap;
|
s.oa = *oap;
|
||||||
normal_prepare(&s);
|
normal_prepare(&s);
|
||||||
input_enable_events();
|
(void)normal_execute(&s, safe_vgetc());
|
||||||
int c = safe_vgetc();
|
|
||||||
input_disable_events();
|
|
||||||
(void)normal_execute(&s, c);
|
|
||||||
*oap = s.oa;
|
*oap = s.oa;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user