fix(blink): cmdline is now top-level on main branch (#5615)

## Description
This `blink.cmp`
[commit](93215d8034)
introduced a breaking change on main branch. `cmdline` is now top-level
and the option is `opts.cmdline.sources = {}`.

I also added a note to remove this hack when the next blink stable
release comes out, which should be greater than current 0.11.0 and just
do it normally in `opts` instead.
<!-- Describe the big picture of your changes to communicate to the
maintainers
  why we should accept this pull request. -->

## Related Issue(s)
None.
<!--
  If this PR fixes any issues, please link to the issue here.
  - Fixes #<issue_number>
-->

## Screenshots

<!-- Add screenshots of the changes if applicable. -->

## Checklist

- [x] I've read the
[CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md)
guidelines.
This commit is contained in:
Iordanis Petkakis 2025-02-15 22:57:48 +02:00 committed by GitHub
parent 4aff0063a4
commit 0458e46dcc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -79,7 +79,6 @@ return {
-- with blink.compat -- with blink.compat
compat = {}, compat = {},
default = { "lsp", "path", "snippets", "buffer" }, default = { "lsp", "path", "snippets", "buffer" },
cmdline = {},
}, },
keymap = { keymap = {
@ -89,6 +88,15 @@ return {
}, },
---@param opts blink.cmp.Config | { sources: { compat: string[] } } ---@param opts blink.cmp.Config | { sources: { compat: string[] } }
config = function(_, opts) config = function(_, opts)
-- HACK: remove when next `blink.cmp` stable release is available
-- and just do `opts.cmdline.sources = {}` directly in `opts`
-- Should be greater than current 0.11.0
if not vim.g.lazyvim_blink_main then
opts.sources["cmdline"] = {}
else
opts.cmdline = opts.cmdline or {}
opts.cmdline.sources = {}
end
-- setup compat sources -- setup compat sources
local enabled = opts.sources.default local enabled = opts.sources.default
for _, source in ipairs(opts.sources.compat or {}) do for _, source in ipairs(opts.sources.compat or {}) do