diff options
author | erw7 <erw7.github@gmail.com> | 2019-05-23 06:38:02 +0900 |
---|---|---|
committer | erw7 <erw7.github@gmail.com> | 2020-02-12 15:30:06 +0900 |
commit | fe395ae210914eeec0f8592268b1960cb1b819b8 (patch) | |
tree | a4957f0f313a279b164036e70c0b4427ead27977 /src/nvim/edit.c | |
parent | 783aecd501de2719f3059252e8444ef00c7c3d4a (diff) | |
download | rneovim-fe395ae210914eeec0f8592268b1960cb1b819b8.tar.gz rneovim-fe395ae210914eeec0f8592268b1960cb1b819b8.tar.bz2 rneovim-fe395ae210914eeec0f8592268b1960cb1b819b8.zip |
vim-patch:8.1.0069: cannot handle pressing CTRL-C in a prompt buffer
Problem: Cannot handle pressing CTRL-C in a prompt buffer.
Solution: Add prompt_setinterrupt().
https://github.com/vim/vim/commit/0e5979a6d491f68c4a8c86fab489016919329a6b
Diffstat (limited to 'src/nvim/edit.c')
-rw-r--r-- | src/nvim/edit.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/nvim/edit.c b/src/nvim/edit.c index 40d34bd0b7..cebd08af28 100644 --- a/src/nvim/edit.c +++ b/src/nvim/edit.c @@ -823,6 +823,16 @@ static int insert_handle_key(InsertState *s) s->nomove = true; return 0; // exit insert mode } + if (s->c == Ctrl_C && bt_prompt(curbuf)) { + if (invoke_prompt_interrupt()) { + if (!bt_prompt(curbuf)) { + // buffer changed to a non-prompt buffer, get out of + // Insert mode + return 0; + } + break; + } + } // when 'insertmode' set, and not halfway through a mapping, don't leave // Insert mode |