vim-patch:8.1.0504: when CTRL-C is mapped it triggers InsertLeave (#9192)

Problem:    When CTRL-C is mapped it triggers InsertLeave.
Solution:   Make CTRL-C behave the same way when typed or used in a mapping.
4dbc262764
This commit is contained in:
Jan Edmund Lazo
2018-11-03 07:04:33 -04:00
committed by Justin M. Keyes
parent 87d67814e5
commit a6661178aa
2 changed files with 34 additions and 1 deletions

View File

@@ -468,7 +468,10 @@ static void insert_enter(InsertState *s)
}
foldUpdateAfterInsert();
if (s->cmdchar != 'r' && s->cmdchar != 'v') {
// When CTRL-C was typed got_int will be set, with the result
// that the autocommands won't be executed. When mapped got_int
// is not set, but let's keep the behavior the same.
if (s->cmdchar != 'r' && s->cmdchar != 'v' && s->c != Ctrl_C) {
ins_apply_autocmds(EVENT_INSERTLEAVE);
}
did_cursorhold = false;