This repository was archived by the owner on Oct 13, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed
Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change 3535function M .addCompletionItems (item_table , item )
3636 -- word cannot be nil
3737 if item .word == nil then return end
38+ local abbr_length = opt .get_option (' abbr_length' )
3839 local menu_length = opt .get_option (' menu_length' )
3940 if menu_length ~= 0 then
40- if string.len (item .abbr ) > menu_length then
41- item .abbr = string.sub (item .abbr , 0 , menu_length ).. " ..."
41+ if item .menu ~= nil and string.len (item .menu ) > menu_length then
42+ item .menu = string.sub (item .menu , 0 , menu_length ).. " ..."
43+ end
44+ end
45+ if item .abbr ~= nil and abbr_length ~= 0 then
46+ if string.len (item .abbr ) > abbr_length then
47+ item .abbr = string.sub (item .abbr , 0 , abbr_length ).. " ..."
4248 end
4349 end
4450 table.insert (item_table , {
Original file line number Diff line number Diff line change @@ -109,6 +109,10 @@ if ! exists('g:completion_items_priority')
109109 let g: completion_items_priority = {}
110110endif
111111
112+ if ! exists (' g:completion_abbr_length' )
113+ let g: completion_abbr_length = 0
114+ endif
115+
112116if ! exists (' g:completion_menu_length' )
113117 let g: completion_menu_length = 0
114118endif
You can’t perform that action at this time.
0 commit comments