Skip to content

Commit c63b01d

Browse files
committed
fix: Take a fresh copy of options object each time
1 parent 5b3d453 commit c63b01d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lua/debugprint/options.lua

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ end
4040

4141
M.get_and_validate_global_opts = function(opts)
4242
local global_opts =
43-
vim.tbl_deep_extend("force", GLOBAL_OPTION_DEFAULTS, opts or {})
43+
vim.tbl_deep_extend("force", vim.deepcopy(GLOBAL_OPTION_DEFAULTS), opts or {})
4444

4545
validate_global_opts(global_opts)
4646

@@ -49,7 +49,7 @@ end
4949

5050
M.get_and_validate_function_opts = function(opts)
5151
local func_opts =
52-
vim.tbl_deep_extend("force", FUNCTION_OPTION_DEFAULTS, opts or {})
52+
vim.tbl_deep_extend("force", vim.deepcopy(FUNCTION_OPTION_DEFAULTS), opts or {})
5353

5454
validate_function_opts(func_opts)
5555

0 commit comments

Comments
 (0)