From 6c4ddf607f0b0b4b72c4a949d796853aa77db08f Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Thu, 29 May 2025 07:09:50 +0800 Subject: [PATCH] vim-patch:9.1.1417: missing info about register completion in complete_info() (#34219) Problem: missing info about register completion in complete_info() (after v9.1.1408) Solution: update documentation and mention that register is used as source, add a test (glepnir) closes: vim/vim#17389 https://github.com/vim/vim/commit/49864aecd0d23676e202b30bc8705c78ae52d680 Co-authored-by: glepnir --- runtime/doc/builtin.txt | 1 + runtime/lua/vim/_meta/vimfn.lua | 1 + src/nvim/eval.lua | 1 + test/old/testdir/test_ins_complete.vim | 3 +++ 4 files changed, 6 insertions(+) diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt index 22bb0a728f..f994686092 100644 --- a/runtime/doc/builtin.txt +++ b/runtime/doc/builtin.txt @@ -1236,6 +1236,7 @@ complete_info([{what}]) *complete_info()* "omni" Omni completion |i_CTRL-X_CTRL-O| "spell" Spelling suggestions |i_CTRL-X_s| "eval" |complete()| completion + "register" Words from registers |i_CTRL-X_CTRL-R| "unknown" Other internal modes If the optional {what} list argument is supplied, then only diff --git a/runtime/lua/vim/_meta/vimfn.lua b/runtime/lua/vim/_meta/vimfn.lua index c4be7e8ea4..cff6399d0a 100644 --- a/runtime/lua/vim/_meta/vimfn.lua +++ b/runtime/lua/vim/_meta/vimfn.lua @@ -1084,6 +1084,7 @@ function vim.fn.complete_check() end --- "omni" Omni completion |i_CTRL-X_CTRL-O| --- "spell" Spelling suggestions |i_CTRL-X_s| --- "eval" |complete()| completion +--- "register" Words from registers |i_CTRL-X_CTRL-R| --- "unknown" Other internal modes --- --- If the optional {what} list argument is supplied, then only diff --git a/src/nvim/eval.lua b/src/nvim/eval.lua index 2cc926888d..3f652997ec 100644 --- a/src/nvim/eval.lua +++ b/src/nvim/eval.lua @@ -1450,6 +1450,7 @@ M.funcs = { "omni" Omni completion |i_CTRL-X_CTRL-O| "spell" Spelling suggestions |i_CTRL-X_s| "eval" |complete()| completion + "register" Words from registers |i_CTRL-X_CTRL-R| "unknown" Other internal modes If the optional {what} list argument is supplied, then only diff --git a/test/old/testdir/test_ins_complete.vim b/test/old/testdir/test_ins_complete.vim index f55b76e330..bfdc9d13a2 100644 --- a/test/old/testdir/test_ins_complete.vim +++ b/test/old/testdir/test_ins_complete.vim @@ -3865,6 +3865,9 @@ func Test_register_completion() call feedkeys("a\\\", 'tx') call assert_equal("zero", getline(1)) + call feedkeys("Sze\\\=string(complete_info(['mode']))\\", "tx") + call assert_equal("zero{'mode': 'register'}", getline(1)) + " Clean up bwipe! delfunc GetItems