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 6aab38a commit ed8cd39
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 @@ -419,7 +419,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 ed8cd39

Please sign in to comment.