Skip to content

Commit d497f4b

Browse files
committed
feat: add fill space for c/cpp
1 parent 11c4c7e commit d497f4b

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

lua/phoenix/init.lua

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -595,15 +595,25 @@ local function collect_completions(prefix)
595595
and string.format('%03d', priority_config.base)
596596
or string.format('%03d', priority_config.base + 100)
597597

598+
local special = { 'c', 'cpp' }
599+
598600
return vim
599601
.iter(ipairs(results))
600602
:map(function(idx, node)
601-
return {
603+
local t = {
602604
label = node.word,
603605
filterText = node.word,
604606
kind = 1,
605607
sortText = string.format('%s%09d%s', sort_prefix, idx, node.word),
606608
}
609+
610+
if vim.list_contains(special, vim.bo[0].filetype) then
611+
t.label = ' ' .. node.word
612+
t.insertText = node.word
613+
t.insertTextFormat = vim.lsp.protocol.InsertTextFormat.PlainText
614+
end
615+
616+
return t
607617
end)
608618
:totable()
609619
end

0 commit comments

Comments
 (0)