From da91b5135fdd8aa0da9e38b39fe1174dd3b878a1 Mon Sep 17 00:00:00 2001 From: Christian Brabandt Date: Sun, 5 Oct 2025 13:00:11 +0000 Subject: [PATCH] patch 9.1.1826: Patch v9.1.1230 causes confusion about Ctrl-C behaviour Problem: Patch v9.1.1230 causes confusion about Ctrl-C behaviour (kuuote, after v9.1.1230) Solution: Revert the behaviour, keep the old behaviour fixes: #17266 Signed-off-by: Christian Brabandt --- runtime/doc/pattern.txt | 5 +++-- runtime/doc/version9.txt | 3 +-- src/popupwin.c | 14 -------------- src/testdir/test_popupwin.vim | 2 +- src/version.c | 2 ++ 5 files changed, 7 insertions(+), 19 deletions(-) diff --git a/runtime/doc/pattern.txt b/runtime/doc/pattern.txt index d726574885..57bcb24277 100644 --- a/runtime/doc/pattern.txt +++ b/runtime/doc/pattern.txt @@ -1,4 +1,4 @@ -*pattern.txt* For Vim version 9.1. Last change: 2025 Sep 24 +*pattern.txt* For Vim version 9.1. Last change: 2025 Oct 05 VIM REFERENCE MANUAL by Bram Moolenaar @@ -141,7 +141,8 @@ CTRL-C Interrupt current (search) command. Use CTRL-Break on help users who use "vim file | grep word" and don't know how to get out (blindly typing :qa would work). - If a popup is open, the active popup will be closed. + If a popup with a |popup-filter| is open, the popup + will be closed. *:noh* *:nohlsearch* :noh[lsearch] Stop the highlighting for the 'hlsearch' option. It diff --git a/runtime/doc/version9.txt b/runtime/doc/version9.txt index 2a4a2d0796..5e366cc48f 100644 --- a/runtime/doc/version9.txt +++ b/runtime/doc/version9.txt @@ -1,4 +1,4 @@ -*version9.txt* For Vim version 9.1. Last change: 2025 Oct 04 +*version9.txt* For Vim version 9.1. Last change: 2025 Oct 05 VIM REFERENCE MANUAL by Bram Moolenaar @@ -41760,7 +41760,6 @@ Others: ~ - the putty terminal is detected using an |TermResponse| autocommand in |defaults.vim| and Vim switches to a dark background - improve the |vimtutor| and add a second chapter for more advanced tips -- |CTRL-C| always closes the active |popup-window|. - the configure script will favor using GTK3 over GTK2 when auto-detecting the gui toolkit - |gv| works in operator pending mode and does not abort diff --git a/src/popupwin.c b/src/popupwin.c index 64f6837719..99e3967469 100644 --- a/src/popupwin.c +++ b/src/popupwin.c @@ -3622,20 +3622,6 @@ 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; diff --git a/src/testdir/test_popupwin.vim b/src/testdir/test_popupwin.vim index eca0a5a68f..129e14cd8b 100644 --- a/src/testdir/test_popupwin.vim +++ b/src/testdir/test_popupwin.vim @@ -3931,7 +3931,7 @@ func Test_popupwin_cancel_with_without_filter() call feedkeys("\", 'xt') call assert_equal({}, popup_getpos(win1)) - call assert_equal({}, popup_getpos(win2)) + call assert_equal(10, popup_getpos(win2).line) call popup_clear() endfunc diff --git a/src/version.c b/src/version.c index 01a0dd08a5..6680030645 100644 --- a/src/version.c +++ b/src/version.c @@ -729,6 +729,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1826, /**/ 1825, /**/