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

@@ -13718,3 +13718,20 @@ void invoke_prompt_callback(void)
tv_clear(&argv[0]);
tv_clear(&rettv);
}
// Return true When the interrupt callback was invoked.
bool invoke_prompt_interrupt(void)
{
typval_T rettv;
typval_T argv[1];
if (curbuf->b_prompt_interrupt.type == kCallbackNone) {
return false;
}
argv[0].v_type = VAR_UNKNOWN;
got_int = false; // don't skip executing commands
callback_call(&curbuf->b_prompt_interrupt, 0, argv, &rettv);
tv_clear(&rettv);
return true;
}