Skip to content

Commit d78c9d0

Browse files
lixiao189Uzaaft
andauthored
fix(nvim-cmp): Check for nil value in opts table (#1559)
* feat(nvim-cmp): fix the issue of opts.sources not being initialized at the start * Update lua/astrocommunity/completion/nvim-cmp/init.lua --------- Co-authored-by: Uzair Aftab <48220549+Uzaaft@users.noreply.github.com>
1 parent cb02020 commit d78c9d0

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

  • lua/astrocommunity/completion/nvim-cmp

lua/astrocommunity/completion/nvim-cmp/init.lua

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,10 @@ return {
222222
specs = {
223223
{
224224
"hrsh7th/nvim-cmp",
225-
opts = function(_, opts) table.insert(opts.sources, { name = "lazydev", group_index = 0 }) end,
225+
opts = function(_, opts)
226+
if not opts.sources then opts.sources = {} end
227+
table.insert(opts.sources, { name = "lazydev", group_index = 0 })
228+
end,
226229
},
227230
},
228231
},

0 commit comments

Comments
 (0)