@@ -56,7 +56,7 @@ local function get_context_aware_snippets(item, completion_item, line_to_cursor)
56
56
end
57
57
end
58
58
item .user_data = {}
59
- local matches
59
+ local matches , word
60
60
word , matches = item .word :gsub (" %(.*%)$" , " " )
61
61
if matches == 0 then
62
62
word , matches = item .word :gsub (" <.*>$" , " " )
@@ -93,6 +93,7 @@ local function text_document_completion_list_to_complete_items(result, params)
93
93
94
94
item .word = get_completion_word (completion_item , params .prefix , params .suffix )
95
95
item .word = item .word :gsub (' \n ' , ' ' )
96
+ item .word = vim .trim (item .word )
96
97
item .dup = opt .get_option (" items_duplicate" )[' lsp' ]
97
98
item .user_data = {
98
99
lsp = {
@@ -102,11 +103,11 @@ local function text_document_completion_list_to_complete_items(result, params)
102
103
if protocol .InsertTextFormat [completion_item .insertTextFormat ] == ' Snippet'
103
104
and opt .get_option (' enable_snippet' ) == " snippets.nvim" then
104
105
item .user_data .actual_item = item .word
105
- item .word = completion_item .label
106
+ item .word = vim . trim ( completion_item .label )
106
107
end
107
108
local kind = protocol .CompletionItemKind [completion_item .kind ]
108
109
item .kind = customize_label [kind ] or kind
109
- item .abbr = completion_item .label
110
+ item .abbr = vim . trim ( completion_item .label )
110
111
if params .suffix ~= nil and # params .suffix ~= 0 then
111
112
local index = item .word :find (params .suffix )
112
113
if index ~= nil then
0 commit comments