mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
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)
5d2e007ccb
Cherry-pick can_cindent_get() -> get_can_cindent() from patch 8.1.2062.
This commit is contained in:
parent
ef748af01d
commit
9ac44c7f5d
@ -5654,7 +5654,7 @@ static char_u *do_insert_char_pre(int c)
|
||||
return res;
|
||||
}
|
||||
|
||||
bool can_cindent_get(void)
|
||||
bool get_can_cindent(void)
|
||||
{
|
||||
return can_cindent;
|
||||
}
|
||||
|
1246
src/nvim/insexpand.c
1246
src/nvim/insexpand.c
File diff suppressed because it is too large
Load Diff
@ -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 <C-R>=, then it should be
|
||||
" processed. Otherwise, CTRL-X mode should be stopped and the key should be
|
||||
" inserted.
|
||||
exe "normal Goa\<C-P>\<C-R>=\"\\<C-P>\"\<CR>"
|
||||
call assert_equal('a123', getline(5))
|
||||
let @r = "\<C-P>\<C-P>"
|
||||
exe "normal GCa\<C-P>\<C-R>r"
|
||||
call assert_equal('a12', getline(5))
|
||||
exe "normal GCa\<C-P>\<C-R>=\"x\"\<CR>"
|
||||
call assert_equal('a1234x', getline(5))
|
||||
bw!
|
||||
endfunc
|
||||
|
||||
func Test_issue_7021()
|
||||
CheckMSWindows
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user