Skip to content

Commit 72acdaa

Browse files
committed
refactor(cmp): use compatiable menu style
1 parent 7edda5f commit 72acdaa

1 file changed

Lines changed: 14 additions & 18 deletions

File tree

lua/modules/configs/completion/blink.lua

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,6 @@ return function()
2222
table.insert(sources_default, 1, "copilot")
2323
end
2424

25-
local border = function(hl)
26-
return {
27-
{ "", hl },
28-
{ "", hl },
29-
{ "", hl },
30-
{ "", hl },
31-
{ "", hl },
32-
{ "", hl },
33-
{ "", hl },
34-
{ "", hl },
35-
}
36-
end
37-
3825
require("modules.utils").load_plugin("blink.cmp", {
3926
snippets = { preset = "luasnip" },
4027
cmdline = { enabled = true },
@@ -99,20 +86,29 @@ return function()
9986
selection = { preselect = false, auto_insert = false },
10087
},
10188
menu = {
102-
border = border("PmenuBorder"),
89+
border = "single",
10390
winhighlight = "Normal:Pmenu,FloatBorder:PmenuBorder,CursorLine:PmenuSel,Search:PmenuSel",
10491
scrollbar = false,
10592
draw = {
93+
padding = { 1, 1 },
10694
columns = {
107-
{ "kind_icon" },
10895
{ "label", "label_description", gap = 1 },
96+
{ "kind_icon" },
10997
{ "kind", "source_name", gap = 1 },
11098
},
11199
components = {
112100
kind_icon = {
113101
text = function(ctx)
114102
local lspkind_icons = vim.tbl_deep_extend("force", icons.kind, icons.type, icons.cmp)
115-
return string.format(" %s ", lspkind_icons[ctx.kind] or icons.cmp.undefined)
103+
return lspkind_icons[ctx.kind] or icons.cmp.undefined
104+
end,
105+
},
106+
kind = {
107+
text = function(ctx)
108+
return ctx.kind or ""
109+
end,
110+
highlight = function(ctx)
111+
return ctx.kind
116112
end,
117113
},
118114
label = {
@@ -135,8 +131,8 @@ return function()
135131
auto_show = true,
136132
auto_show_delay_ms = 200,
137133
window = {
138-
border = border("CmpDocBorder"),
139-
winhighlight = "Normal:CmpDoc",
134+
border = "single",
135+
winhighlight = "Normal:CmpDoc,FloatBorder:CmpDocBorder",
140136
},
141137
},
142138
},

0 commit comments

Comments
 (0)