Skip to content

Commit

Permalink
fix: Take a fresh copy of options object each time
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewferrier committed Mar 29, 2024
1 parent 5b3d453 commit c63b01d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lua/debugprint/options.lua
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ end

M.get_and_validate_global_opts = function(opts)
local global_opts =
vim.tbl_deep_extend("force", GLOBAL_OPTION_DEFAULTS, opts or {})
vim.tbl_deep_extend("force", vim.deepcopy(GLOBAL_OPTION_DEFAULTS), opts or {})

validate_global_opts(global_opts)

Expand All @@ -49,7 +49,7 @@ end

M.get_and_validate_function_opts = function(opts)
local func_opts =
vim.tbl_deep_extend("force", FUNCTION_OPTION_DEFAULTS, opts or {})
vim.tbl_deep_extend("force", vim.deepcopy(FUNCTION_OPTION_DEFAULTS), opts or {})

validate_function_opts(func_opts)

Expand Down

0 comments on commit c63b01d

Please sign in to comment.