Skip to content

Commit

Permalink
docs: drop idx in menu when >= 10
Browse files Browse the repository at this point in the history
  • Loading branch information
Saghen committed Dec 19, 2024
1 parent 28ef585 commit 20c37fa
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -950,23 +950,14 @@ keymap = {
['<A-7>'] = { function(cmp) cmp.accept({ index = 7 }) end },
['<A-8>'] = { function(cmp) cmp.accept({ index = 8 }) end },
['<A-9>'] = { function(cmp) cmp.accept({ index = 9 }) end },
['<A-0>'] = { function(cmp) cmp.accept({ index = 10 }) end },
},
completion = {
menu = {
draw = {
columns = { { 'item_idx' }, { 'kind_icon' }, { 'label', 'label_description', gap = 1 } },
components = {
item_idx = {
text = function(ctx)
if ctx.idx == 10 then
return '0'
elseif ctx.idx > 10 then
return ' '
else
return tostring(ctx.idx)
end
end,
text = function(ctx) return ctx.idx >= 10 and ' ' or tostring(ctx.idx) end,
highlight = 'BlinkCmpItemIdx' -- optional, only if you want to change its color
}
}
Expand Down

0 comments on commit 20c37fa

Please sign in to comment.