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 35
35
function M .addCompletionItems (item_table , item )
36
36
-- word cannot be nil
37
37
if item .word == nil then return end
38
+ local abbr_length = opt .get_option (' abbr_length' )
38
39
local menu_length = opt .get_option (' menu_length' )
39
40
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 ).. " ..."
42
48
end
43
49
end
44
50
table.insert (item_table , {
Original file line number Diff line number Diff line change @@ -109,6 +109,10 @@ if ! exists('g:completion_items_priority')
109
109
let g: completion_items_priority = {}
110
110
endif
111
111
112
+ if ! exists (' g:completion_abbr_length' )
113
+ let g: completion_abbr_length = 0
114
+ endif
115
+
112
116
if ! exists (' g:completion_menu_length' )
113
117
let g: completion_menu_length = 0
114
118
endif
You can’t perform that action at this time.
0 commit comments