0
0
mirror of https://github.com/vim/vim.git synced 2025-10-30 09:47:20 -04:00

patch 9.1.1230: inconsistent CTRL-C behaviour for popup windows

Problem:  Ctrl-C closes popup windows that have a filter callback,
          but does not close popups without a filter callback.
Solution: Modified popup_do_filter() to also close popups without
          filter callback when Ctrl-C is pressed (glepnir).

fixes: #16839
closes: #16928

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
glepnir
2025-03-21 18:12:32 +01:00
committed by Christian Brabandt
parent 9712a2534f
commit 8a63529a2f
5 changed files with 38 additions and 2 deletions

View File

@@ -3586,6 +3586,20 @@ popup_do_filter(int c)
&& (wp->w_filter_mode & state) != 0)
res = invoke_popup_filter(wp, c);
// when Ctrl-C and no popup has been processed (res is still FALSE)
// Try to find and close a popup that has no filter callback
if (c == Ctrl_C && res == FALSE)
{
popup_reset_handled(POPUP_HANDLED_2);
wp = find_next_popup(FALSE, POPUP_HANDLED_2);
if (wp != NULL)
{
popup_close_with_retval(wp, -1);
res = TRUE;
}
}
if (must_redraw > was_must_redraw)
{
int save_got_int = got_int;