mirror of
https://github.com/neovim/neovim
synced 2025-07-16 01:01:49 +00:00
Merge pull request #34294 from glepnir/vim-9.1.1426
vim-patch:9.1.{1426,1428}: register completion improve
This commit is contained in:
@ -4751,6 +4751,27 @@ func Test_register_completion()
|
||||
call feedkeys("Sze\<C-X>\<C-R>\<C-R>=string(complete_info(['mode']))\<CR>\<ESC>", "tx")
|
||||
call assert_equal("zero{'mode': 'register'}", getline(1))
|
||||
|
||||
" Test consecutive CTRL-X CTRL-R (adding mode)
|
||||
" First CTRL-X CTRL-R should split into words, second should use full content
|
||||
let @f = "hello world test complete"
|
||||
call setline(1, "hel")
|
||||
call cursor(1, 3)
|
||||
call feedkeys("a\<C-X>\<C-R>\<C-N>\<Esc>", 'tx')
|
||||
call assert_equal("hello", getline(1))
|
||||
|
||||
" Second consecutive CTRL-X CTRL-R should complete with full content
|
||||
call setline(1, "hello")
|
||||
call cursor(1, 5)
|
||||
call feedkeys("a\<C-X>\<C-R>\<C-X>\<C-R>\<Esc>", 'tx')
|
||||
call assert_equal("hello world test complete", getline(1))
|
||||
|
||||
" Test consecutive completion with multi-line register
|
||||
let @g = "first line content\nsecond line here\nthird line data"
|
||||
call setline(1, "first")
|
||||
call cursor(1, 5)
|
||||
call feedkeys("a\<C-X>\<C-R>\<C-X>\<C-R>\<Esc>", 'tx')
|
||||
call assert_equal("first line content", getline(1))
|
||||
|
||||
" Clean up
|
||||
bwipe!
|
||||
delfunc GetItems
|
||||
|
Reference in New Issue
Block a user