mirror of
https://github.com/neovim/neovim.git
synced 2025-09-05 19:08:15 +00:00
vim-patch:8.2.3467: CursorHoldI event interferes with "CTRL-G U"
Problem: CursorHoldI event interferes with "CTRL-G U". (Naohiro Ono) Solution: Restore the flag for "CTRL-G U" after triggering CursorHoldI. (closes vim/vim#8937)5a9357d0bf
Co-authored-by: Bram Moolenaar <Bram@vim.org> (cherry picked from commita5445f5435
)
This commit is contained in:

committed by
github-actions[bot]
![github-actions[bot]](/assets/img/avatar_default.png)
parent
b4f58d6745
commit
2b2a20f4ea
@@ -876,6 +876,10 @@ static int insert_handle_key(InsertState *s)
|
||||
|
||||
case K_EVENT: // some event
|
||||
state_handle_k_event();
|
||||
// If CTRL-G U was used apply it to the next typed key.
|
||||
if (dont_sync_undo == kTrue) {
|
||||
dont_sync_undo = kNone;
|
||||
}
|
||||
goto check_pum;
|
||||
|
||||
case K_COMMAND: // some command
|
||||
|
@@ -103,6 +103,22 @@ if has('timers')
|
||||
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()
|
||||
CheckFunction test_override
|
||||
call test_override('starting', 1)
|
||||
|
Reference in New Issue
Block a user