mirror of
https://github.com/neovim/neovim.git
synced 2026-07-09 10:59:38 +00:00
vim-patch:9.2.0748: 'autocompletedelay' interferes with CTRL-G U
Problem: 'autocompletedelay' interferes with CTRL-G U (after 9.2.0739).
Solution: Restore the flag for CTRL-G U.
related: vim/vim#8937
related: vim/vim#20666
9fb5b5d876
This commit is contained in:
@@ -1005,6 +1005,10 @@ static int insert_handle_key(InsertState *s)
|
||||
}
|
||||
|
||||
case K_COMPLETE_DELAY: // 'autocompletedelay' expired
|
||||
// If CTRL-G U was used apply it to the next typed key.
|
||||
if (dont_sync_undo == kTrue) {
|
||||
dont_sync_undo = kNone;
|
||||
}
|
||||
ins_compl_clear_autocomplete_delay();
|
||||
if (!ins_compl_has_autocomplete() || char_avail() || curwin->w_cursor.col == 0) {
|
||||
break;
|
||||
|
||||
@@ -6068,6 +6068,30 @@ func Test_autocompletedelay()
|
||||
call StopVimInTerminal(buf)
|
||||
endfunc
|
||||
|
||||
func Run_test_autocompletedelay_ctrl_g_U(delay1, delay2)
|
||||
new
|
||||
call setline(1, 'foo bar baz')
|
||||
inoremap <buffer> ( ()<C-g>U
|
||||
set autocomplete autocompletedelay=200
|
||||
|
||||
call timer_start(a:delay1, { -> feedkeys('(', 't') })
|
||||
call timer_start(a:delay2, { -> feedkeys("\<Left>a\<Esc>", 't') })
|
||||
call feedkeys('ob', 'tx!')
|
||||
call assert_equal(['foo bar baz', 'b(a)'], getline(1, '$'))
|
||||
undo
|
||||
call assert_equal(['foo bar baz'], getline(1, '$'))
|
||||
|
||||
set autocomplete& autocompletedelay&
|
||||
bwipe!
|
||||
endfunc
|
||||
|
||||
func Test_autocompletedelay_ctrl_g_U()
|
||||
" '(' typed after 'autocompletedelay' expires
|
||||
call Run_test_autocompletedelay_ctrl_g_U(250, 500)
|
||||
" '(' typed before 'autocompletedelay' expires
|
||||
call Run_test_autocompletedelay_ctrl_g_U(150, 500)
|
||||
endfunc
|
||||
|
||||
" Preinsert longest prefix when autocomplete
|
||||
func Test_autocomplete_longest()
|
||||
func GetLine()
|
||||
|
||||
Reference in New Issue
Block a user