Patch 8.2.3467
Problem: CursorHoldI event interferes with "CTRL-G U". (Naohiro Ono)
Solution: Restore the flag for "CTRL-G U" after triggering CursorHoldI.
(closes #8937)
Files: src/edit.c, src/testdir/test_autocmd.vim
*** ../vim-8.2.3466/src/edit.c 2021-09-16 21:31:48.023014473 +0100
--- src/edit.c 2021-10-03 16:20:28.237262059 +0100
***************
*** 1057,1062 ****
--- 1057,1065 ----
case K_CURSORHOLD: // Didn't type something for a while.
ins_apply_autocmds(EVENT_CURSORHOLDI);
did_cursorhold = TRUE;
+ // If CTRL-G U was used apply it to the next typed key.
+ if (dont_sync_undo == TRUE)
+ dont_sync_undo = MAYBE;
break;
#ifdef FEAT_GUI_MSWIN
*** ../vim-8.2.3466/src/testdir/test_autocmd.vim 2021-09-22 13:18:09.313222517 +0100
--- src/testdir/test_autocmd.vim 2021-10-03 16:19:25.383901846 +0100
***************
*** 100,105 ****
--- 100,121 ----
set updatetime&
endfunc
+ func Test_cursorhold_insert_ctrl_g_U()
+ au CursorHoldI * :
+ set updatetime=20
+ new
+ call timer_start(100, { -> feedkeys("\<Left>foo\<Esc>", 't') })
+ call feedkeys("i()\<C-g>U", 'tx!')
+ sleep 200m
+ call assert_equal('(foo)', getline(1))
+ undo
+ call assert_equal('', getline(1))
+
+ bwipe!
+ au! CursorHoldI
+ set updatetime&
+ endfunc
+
func Test_OptionSet_modeline()
call test_override('starting', 1)
au! OptionSet
*** ../vim-8.2.3466/src/version.c 2021-10-03 15:19:09.821731156 +0100
--- src/version.c 2021-10-03 16:19:53.336507133 +0100
***************
*** 759,760 ****
--- 759,762 ----
{ /* Add new patch number below this line */
+ /**/
+ 3467,
/**/
--
I AM THANKFUL...
...for the mess to clean after a party because it means I have
been surrounded by friends.
/// Bram Moolenaar -- Br...@Moolenaar.net --
http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features --
http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims --
http://ICCF-Holland.org ///