vim-patch:9.2.1009: duplicate dict code in ins_compl_dict_alloc() (#41497)

Problem:  ins_compl_dict_alloc() builds the same dict as
          fill_complete_info_dict().
Solution: Call fill_complete_info_dict() instead (glepnir).

closes: vim/vim#21140

303a153694
This commit is contained in:
glepnir
2026-08-26 16:37:44 +08:00
committed by GitHub
parent f9186e0c0e
commit f0146bcbe7
2 changed files with 13 additions and 14 deletions

View File

@@ -65,10 +65,16 @@ describe('completion', function()
it('returns expected dict in normal completion', function()
feed('ifoo<ESC>o<C-x><C-n>')
eq('foo', eval('getline(2)'))
eq(
{ word = 'foo', abbr = '', menu = '', info = '', kind = '', user_data = '' },
eval('v:completed_item')
)
eq({
word = 'foo',
abbr = '',
menu = '',
info = '',
kind = '',
user_data = '',
abbr_hlgroup = '',
kind_hlgroup = '',
}, eval('v:completed_item'))
end)
it('is readonly', function()
screen:try_resize(80, 8)
@@ -105,6 +111,8 @@ describe('completion', function()
menu = 'baz',
info = 'foobar',
kind = 'foobaz',
abbr_hlgroup = '',
kind_hlgroup = '',
user_data = '',
}, eval('v:completed_item'))
end)