Skip to content

Commit 53be268

Browse files
committed
bugfix for c utf8 error for #383
1 parent b481ffe commit 53be268

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lua/easycomplete/util.lua

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ function util.get_vim_complete_items(response, plugin_name, word)
176176
if vim.o.filetype == 'dart' and vim.fn['easycomplete#util#BadBoy_Dart'](l_completion_item, typing_word) then
177177
goto continue
178178
end
179-
179+
180180
local l_expandable = false
181181
if l_completion_item["insertTextFormat"] == 2 then
182182
l_expandable = true
@@ -220,10 +220,11 @@ function util.get_vim_complete_items(response, plugin_name, word)
220220
l_vim_complete_item["word"] = l_completion_item['label']
221221
end
222222
if plugin_name == "cpp" and string.find(l_completion_item['label'], "^[•%s]") then
223-
l_vim_complete_item["word"] = string.gsub(l_completion_item['label'], "^[•%s]", "")
223+
l_vim_complete_item["word"] = string.gsub(l_completion_item['label'], "^•", "")
224+
l_vim_complete_item["word"] = string.gsub(l_vim_complete_item["word"], "^%s", "")
224225
l_completion_item["label"] = l_vim_complete_item["word"]
225226
end
226-
227+
227228
if l_expandable == true then
228229
local l_origin_word = l_vim_complete_item['word']
229230
local l_placeholder_regex = [[\$[0-9]\+\|\${\%(\\.\|[^}]\)\+}]]

0 commit comments

Comments
 (0)