Skip to content

Commit

Permalink
fix: support calling setup() w/o args
Browse files Browse the repository at this point in the history
Avoids error `attempt to index local 'opts' (a nil value)` when calling
setup() without arguments.

Co-authored-by: Tristan Knight <[email protected]>
  • Loading branch information
tmfink and tris203 committed Jun 16, 2024
1 parent 7a76d43 commit 626aca7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lua/precognition/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,8 @@ end

---@param opts Precognition.PartialConfig
function M.setup(opts)
config = vim.tbl_deep_extend("force", default, opts or {})
opts = opts or {}
config = vim.tbl_deep_extend("force", default, opts)
if opts.highlightColor then
config.highlightColor = opts.highlightColor
end
Expand Down

0 comments on commit 626aca7

Please sign in to comment.