Hi,
Op ma 2 jun 2025 20:00 schreef Christian Brabandt <[email protected]>: > patch 9.1.1426: completion: register contents not completed > > Commit: > https://github.com/vim/vim/commit/d5fdfa5c9cf00790cf720e15c580a591a09fa906 > Author: glepnir <[email protected]> > Date: Mon Jun 2 19:45:41 2025 +0200 > > patch 9.1.1426: completion: register contents not completed > > Problem: CTRL-X CTRL-R only completes individual words from registers, > making it difficult to insert complete register content. > Solution: Add consecutive CTRL-X CTRL-R support - first press completes > words, second press completes full register lines, similar to > CTRL-X CTRL-L and CTRL-X CTRL-P behavior (glepnir). > > closes: #17395 > > > index f3c29d1e7..7d67e9f05 100644 > --- a/src/testdir/test_ins_complete.vim > +++ b/src/testdir/test_ins_complete.vim > @@ -4670,6 +4670,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 > second line here > third 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! > Is only the first line added, or also the second and third? Either way, this should be tested as well. Christ van Willegen > > -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion visit https://groups.google.com/d/msgid/vim_dev/CA%2BOt1OxoynB95K8AXkTUFM4uX-va_CcuRLOw-oLoTtF%2BSrMUYg%40mail.gmail.com.
