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().
0e5979a6d4
This commit is contained in:
erw7
2019-05-23 06:38:02 +09:00
parent 783aecd501
commit fe395ae210
6 changed files with 77 additions and 10 deletions

View File

@@ -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