File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- *pattern.txt* For Vim version 9.1. Last change: 2024 Dec 26
1+ *pattern.txt* For Vim version 9.1. Last change: 2025 Mar 21
22
33
44 VIM REFERENCE MANUAL by Bram Moolenaar
@@ -141,6 +141,7 @@ CTRL-C Interrupt current (search) command. Use CTRL-Break on
141141 help users who use "vim file | grep word" and don't
142142 know how to get out (blindly typing :qa<CR> would
143143 work).
144+ If a popup is open, the active popup will be closed.
144145
145146 *:noh* *:nohlsearch*
146147:noh[lsearch] Stop the highlighting for the 'hlsearch' option. It
Original file line number Diff line number Diff line change 1- *version9.txt* For Vim version 9.1. Last change: 2025 Mar 19
1+ *version9.txt* For Vim version 9.1. Last change: 2025 Mar 21
22
33
44 VIM REFERENCE MANUAL by Bram Moolenaar
@@ -41653,6 +41653,7 @@ Others: ~
4165341653- add |dist#vim9#Launch()| and |dist#vim9#Open()| to the |vim-script-library|
4165441654 and decouple it from |netrw|
4165541655- new digraph "APPROACHES THE LIMIT" using ".="
41656+ - |CTRL-C| always closes the active |popup-window|.
4165641657
4165741658 *added-9.2*
4165841659Added ~
Original file line number Diff line number Diff line change @@ -3586,6 +3586,20 @@ popup_do_filter(int c)
35863586 && (wp -> w_filter_mode & state ) != 0 )
35873587 res = invoke_popup_filter (wp , c );
35883588
3589+ // when Ctrl-C and no popup has been processed (res is still FALSE)
3590+ // Try to find and close a popup that has no filter callback
3591+ if (c == Ctrl_C && res == FALSE)
3592+ {
3593+ popup_reset_handled (POPUP_HANDLED_2 );
3594+ wp = find_next_popup (FALSE, POPUP_HANDLED_2 );
3595+ if (wp != NULL )
3596+ {
3597+ popup_close_with_retval (wp , -1 );
3598+ res = TRUE;
3599+ }
3600+ }
3601+
3602+
35893603 if (must_redraw > was_must_redraw )
35903604 {
35913605 int save_got_int = got_int ;
Original file line number Diff line number Diff line change @@ -3898,6 +3898,24 @@ func Test_popupwin_cancel()
38983898 call assert_equal ({}, popup_getpos (win3))
38993899endfunc
39003900
3901+ func Test_popupwin_cancel_with_without_filter ()
3902+ let win1 = popup_create (' with filter' , #{line : 5 , filter : {... - > 0 }})
3903+ let win2 = popup_create (' no filter' , #{line : 10 })
3904+
3905+ call assert_equal (5 , popup_getpos (win1).line )
3906+ call assert_equal (10 , popup_getpos (win2).line )
3907+
3908+ call feedkeys (" \<C-C> " , ' xt' )
3909+ call assert_equal ({}, popup_getpos (win1))
3910+ call assert_equal (10 , popup_getpos (win2).line )
3911+
3912+ call feedkeys (" \<C-C> " , ' xt' )
3913+ call assert_equal ({}, popup_getpos (win1))
3914+ call assert_equal ({}, popup_getpos (win2))
3915+
3916+ call popup_clear ()
3917+ endfunc
3918+
39013919func Test_popupwin_filter_redraw ()
39023920 " Create two popups with a filter that closes the popup when typing "0".
39033921 " Both popups should close, even though the redraw also calls
Original file line number Diff line number Diff line change @@ -704,6 +704,8 @@ static char *(features[]) =
704704
705705static int included_patches [] =
706706{ /* Add new patch number below this line */
707+ /**/
708+ 1230 ,
707709/**/
708710 1229 ,
709711/**/
You can’t perform that action at this time.
0 commit comments