mirror of
https://github.com/neovim/neovim.git
synced 2025-12-03 07:23:05 +00:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user