From fe395ae210914eeec0f8592268b1960cb1b819b8 Mon Sep 17 00:00:00 2001 From: erw7 Date: Thu, 23 May 2019 06:38:02 +0900 Subject: 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 --- src/nvim/edit.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/nvim/edit.c') 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 -- cgit