Skip to content

Commit

Permalink
fix(snippets): fix nullpointer exception (#355)
Browse files Browse the repository at this point in the history
  • Loading branch information
aniaan authored Nov 20, 2024
1 parent 285f6f4 commit 3ac471b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lua/blink/cmp/sources/snippets/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@
local snippets = {}

function snippets.new(opts)
opts = opts or {}
local self = setmetatable({}, { __index = snippets })
--- @type table<string, blink.cmp.CompletionItem[]>
self.cache = {}
--- @type blink.cmp.SnippetsOpts
self.registry = require('blink.cmp.sources.snippets.registry').new(opts or {})
self.registry = require('blink.cmp.sources.snippets.registry').new(opts)
self.get_filetype = opts.get_filetype or function() return vim.bo.filetype end
return self
end
Expand Down

0 comments on commit 3ac471b

Please sign in to comment.