main: Refactor normal_enter to call os_inchar directly

This makes it impossible for K_EVENT to interfere with mappings, but it also
disables processing of events while in the middle of a mapping (Though this will
be fixed later as this refactoring progresses).

`may_sync_undo` is now called when K_EVENT is received. This is necessary to
correctly update undo entry lists before executing some action.
This commit is contained in:
Thiago de Arruda
2015-10-05 12:02:13 -03:00
parent 32594a33a3
commit 350ffc63db
3 changed files with 37 additions and 8 deletions

View File

@@ -1131,7 +1131,7 @@ static void gotchars(char_u *chars, int len)
* - While reading a script file.
* - When no_u_sync is non-zero.
*/
static void may_sync_undo(void)
void may_sync_undo(void)
{
if ((!(State & (INSERT + CMDLINE)) || arrow_used)
&& scriptin[curscript] == NULL)