From 9ac44c7f5daf28cd155942dbc697b51c6b3afdc0 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Wed, 24 Aug 2022 13:15:38 +0800 Subject: vim-patch:8.2.3944: insert mode completion functions are too long Problem: Insert mode completion functions are too long. Solution: Split up into multiple functions. (Yegappan Lakshmanan, closes vim/vim#9431) https://github.com/vim/vim/commit/5d2e007ccbfbd749a1f201d06965b8811ff50e6e Cherry-pick can_cindent_get() -> get_can_cindent() from patch 8.1.2062. --- src/nvim/testdir/test_ins_complete.vim | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/test_ins_complete.vim b/src/nvim/testdir/test_ins_complete.vim index 4cdede9cd0..6f5f72e1ed 100644 --- a/src/nvim/testdir/test_ins_complete.vim +++ b/src/nvim/testdir/test_ins_complete.vim @@ -873,6 +873,25 @@ func Test_complete_stop() close! endfunc +" Test for typing CTRL-R in insert completion mode to insert a register +" content. +func Test_complete_reginsert() + new + call setline(1, ['a1', 'a12', 'a123', 'a1234']) + + " if a valid CTRL-X mode key is returned from =, then it should be + " processed. Otherwise, CTRL-X mode should be stopped and the key should be + " inserted. + exe "normal Goa\\=\"\\\"\" + call assert_equal('a123', getline(5)) + let @r = "\\" + exe "normal GCa\\r" + call assert_equal('a12', getline(5)) + exe "normal GCa\\=\"x\"\" + call assert_equal('a1234x', getline(5)) + bw! +endfunc + func Test_issue_7021() CheckMSWindows -- cgit