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

49864aecd0

Co-authored-by: glepnir <glephunter@gmail.com>
This commit is contained in:
zeertzjq
2025-05-29 07:09:50 +08:00
committed by GitHub
parent 03933fe4c0
commit 6c4ddf607f
4 changed files with 6 additions and 0 deletions

View File

@@ -1236,6 +1236,7 @@ complete_info([{what}]) *complete_info()*
"omni" Omni completion |i_CTRL-X_CTRL-O| "omni" Omni completion |i_CTRL-X_CTRL-O|
"spell" Spelling suggestions |i_CTRL-X_s| "spell" Spelling suggestions |i_CTRL-X_s|
"eval" |complete()| completion "eval" |complete()| completion
"register" Words from registers |i_CTRL-X_CTRL-R|
"unknown" Other internal modes "unknown" Other internal modes
If the optional {what} list argument is supplied, then only If the optional {what} list argument is supplied, then only

View File

@@ -1084,6 +1084,7 @@ function vim.fn.complete_check() end
--- "omni" Omni completion |i_CTRL-X_CTRL-O| --- "omni" Omni completion |i_CTRL-X_CTRL-O|
--- "spell" Spelling suggestions |i_CTRL-X_s| --- "spell" Spelling suggestions |i_CTRL-X_s|
--- "eval" |complete()| completion --- "eval" |complete()| completion
--- "register" Words from registers |i_CTRL-X_CTRL-R|
--- "unknown" Other internal modes --- "unknown" Other internal modes
--- ---
--- If the optional {what} list argument is supplied, then only --- If the optional {what} list argument is supplied, then only

View File

@@ -1450,6 +1450,7 @@ M.funcs = {
"omni" Omni completion |i_CTRL-X_CTRL-O| "omni" Omni completion |i_CTRL-X_CTRL-O|
"spell" Spelling suggestions |i_CTRL-X_s| "spell" Spelling suggestions |i_CTRL-X_s|
"eval" |complete()| completion "eval" |complete()| completion
"register" Words from registers |i_CTRL-X_CTRL-R|
"unknown" Other internal modes "unknown" Other internal modes
If the optional {what} list argument is supplied, then only If the optional {what} list argument is supplied, then only

View File

@@ -3865,6 +3865,9 @@ func Test_register_completion()
call feedkeys("a\<C-X>\<C-R>\<Esc>", 'tx') call feedkeys("a\<C-X>\<C-R>\<Esc>", 'tx')
call assert_equal("zero", getline(1)) call assert_equal("zero", getline(1))
call feedkeys("Sze\<C-X>\<C-R>\<C-R>=string(complete_info(['mode']))\<CR>\<ESC>", "tx")
call assert_equal("zero{'mode': 'register'}", getline(1))
" Clean up " Clean up
bwipe! bwipe!
delfunc GetItems delfunc GetItems