add visibility handling for the floating window

This commit is contained in:
2025-12-23 22:31:39 +01:00
parent e92c8476c2
commit 463d0ae2f7
5 changed files with 134 additions and 25 deletions

View File

@@ -1,6 +1,6 @@
local M = {}
M.defaults = {
local defaults = {
runner_modules = {
"test-samurai.runners.go",
"test-samurai.runners.js-jest",
@@ -9,18 +9,18 @@ M.defaults = {
},
}
M.options = vim.deepcopy(M.defaults)
local current = vim.deepcopy(defaults)
function M.setup(opts)
if not opts or next(opts) == nil then
M.options = vim.deepcopy(M.defaults)
function M.set(opts)
if type(opts) ~= "table" then
current = vim.deepcopy(defaults)
return
end
M.options = vim.tbl_deep_extend("force", M.defaults, opts)
current = vim.tbl_deep_extend("force", vim.deepcopy(defaults), opts)
end
function M.get()
return M.options
return current or defaults
end
return M