Skip to content

Commit

Permalink
docs: exclude idx >= 10 from select nth from list
Browse files Browse the repository at this point in the history
  • Loading branch information
Saghen committed Dec 19, 2024
1 parent 28ef585 commit ed1ab49
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 ed1ab49

Please sign in to comment.