diff options
author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2018-11-03 07:04:33 -0400 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2018-11-03 12:04:33 +0100 |
commit | a6661178aa5dc2f1687131685423cb72f28e141a (patch) | |
tree | c2035127ab52eba21a6619fa317b5d1d6848e2bf /src/nvim/edit.c | |
parent | 87d67814e58b875a1cb4de4c39c252e028b5eafb (diff) | |
download | rneovim-a6661178aa5dc2f1687131685423cb72f28e141a.tar.gz rneovim-a6661178aa5dc2f1687131685423cb72f28e141a.tar.bz2 rneovim-a6661178aa5dc2f1687131685423cb72f28e141a.zip |
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.
https://github.com/vim/vim/commit/4dbc2627641a6b950c30c31cbf7b7e6c36da1927
Diffstat (limited to 'src/nvim/edit.c')
-rw-r--r-- | src/nvim/edit.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/nvim/edit.c b/src/nvim/edit.c index 7a0487bb64..d20660bfb9 100644 --- a/src/nvim/edit.c +++ b/src/nvim/edit.c @@ -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; |