diff options
author | Bram Moolenaar <Bram@vim.org> | 2018-11-02 11:59:15 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2018-11-02 11:59:15 +0100 |
commit | 4dbc2627641a6b950c30c31cbf7b7e6c36da1927 (patch) | |
tree | 01a06742db92d299a694a3f7a3813df95834b593 /src/edit.c | |
parent | f7acf2b63ce91ea802dbcf0618f0cdee80993468 (diff) |
patch 8.1.0504: when CTRL-C is mapped it triggers InsertLeavev8.1.0504
Problem: When CTRL-C is mapped it triggers InsertLeave.
Solution: Make CTRL-C behave the same way when typed or used in a mapping.
Diffstat (limited to 'src/edit.c')
-rw-r--r-- | src/edit.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/edit.c b/src/edit.c index 4b9bdffb47..239881ee5c 100644 --- a/src/edit.c +++ b/src/edit.c @@ -1048,7 +1048,10 @@ doESCkey: if (ins_esc(&count, cmdchar, nomove)) { - if (cmdchar != 'r' && 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 (cmdchar != 'r' && cmdchar != 'v' && c != Ctrl_C) ins_apply_autocmds(EVENT_INSERTLEAVE); did_cursorhold = FALSE; return (c == Ctrl_O); @@ -2408,7 +2411,7 @@ has_compl_option(int dict_opt) int vim_is_ctrl_x_key(int c) { - /* Always allow ^R - let it's results then be checked */ + // Always allow ^R - let its results then be checked if (c == Ctrl_R) return TRUE; |