Skip to content

Commit

Permalink
fix: invalid configuration and readme after refactor
Browse files Browse the repository at this point in the history
Closes #394
  • Loading branch information
Saghen committed Nov 28, 2024
1 parent 1b3cd31 commit 56f7cb6
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ MiniDeps.add({
--
-- ['<Tab>'] = {
-- function(cmp)
-- if cmp.is_in_snippet() then return cmp.accept()
-- if cmp.snippet_active() then return cmp.accept()
-- else return cmp.select_and_accept() end
-- end,
-- 'snippet_forward',
Expand Down Expand Up @@ -383,7 +383,7 @@ MiniDeps.add({
ellipsis = false,
text = function(ctx) return ctx.kind_icon .. ctx.icon_gap end,
highlight = function(ctx)
return require('blink.cmp.lib.utils').get_tailwind_hl(ctx) or 'BlinkCmpKind' .. ctx.kind
return require('blink.cmp.completion.windows.render.tailwind').get_hl(ctx) or 'BlinkCmpKind' .. ctx.kind
end,
},

Expand All @@ -392,7 +392,7 @@ MiniDeps.add({
width = { fill = true },
text = function(ctx) return ctx.kind end,
highlight = function(ctx)
return require('blink.cmp.lib.utils').get_tailwind_hl(ctx) or 'BlinkCmpKind' .. ctx.kind
return require('blink.cmp.completion.windows.render.tailwind').get_hl(ctx) or 'BlinkCmpKind' .. ctx.kind
end,
},

Expand Down Expand Up @@ -757,7 +757,7 @@ completion.menu.draw = {
ellipsis = false,
text = function(ctx) return ctx.kind_icon .. ctx.icon_gap end,
highlight = function(ctx)
return require('blink.cmp.lib.utils').get_tailwind_hl(ctx) or 'BlinkCmpKind' .. ctx.kind
return require('blink.cmp.completion.windows.render.tailwind').get_hl(ctx) or 'BlinkCmpKind' .. ctx.kind
end,
},

Expand All @@ -766,7 +766,7 @@ completion.menu.draw = {
width = { fill = true },
text = function(ctx) return ctx.kind end,
highlight = function(ctx)
return require('blink.cmp.lib.utils').get_tailwind_hl(ctx) or 'BlinkCmpKind' .. ctx.kind
return require('blink.cmp.completion.windows.render.tailwind').get_hl(ctx) or 'BlinkCmpKind' .. ctx.kind
end,
},

Expand Down
2 changes: 1 addition & 1 deletion lua/blink/cmp/config/keymap.lua
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
---
--- ['<Tab>'] = {
--- function(cmp)
--- if cmp.is_in_snippet() then return cmp.accept()
--- if cmp.snippet_active() then return cmp.accept()
--- else return cmp.select_and_accept() end
--- end,
--- 'snippet_forward',
Expand Down
4 changes: 2 additions & 2 deletions lua/blink/cmp/config/sources.lua
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,13 @@ function sources.validate(config)
providers = { config.providers, 'table' },
})
validate('sources.completion', {
enabled_providers = { config.completion.enabled_providers, 'table' },
enabled_providers = { config.completion.enabled_providers, { 'table', 'function' } },
})
for key, provider in pairs(config.providers) do
validate('sources.providers.' .. key, {
name = { provider.name, 'string' },
module = { provider.module, 'string' },
enabled = { provider.enabled, 'boolean', true },
enabled = { provider.enabled, { 'boolean', 'function' }, true },
opts = { provider.opts, 'table', true },
transform_items = { provider.transform_items, 'function', true },
should_show_items = { provider.should_show_items, { 'boolean', 'function' }, true },
Expand Down
2 changes: 1 addition & 1 deletion lua/blink/cmp/keymap/presets.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ local presets = {

['<Tab>'] = {
function(cmp)
if cmp.is_in_snippet() then
if cmp.snippet_active() then
return cmp.accept()
else
return cmp.select_and_accept()
Expand Down

0 comments on commit 56f7cb6

Please sign in to comment.