Add option to choose random server port (#65)

Updates the plugin to automatically choose a random port when started when no port is provided. This will allow multiple Neovim instances to open at the same time in different projects.
This commit is contained in:
johnybx
2023-10-21 17:39:37 +02:00
committed by GitHub
parent 2100bf2e43
commit c8a0267ba6
5 changed files with 119 additions and 66 deletions

View File

@@ -126,20 +126,10 @@ M.create_popup_state = function(title, width, height)
end
M.merge = function(defaults, overrides)
local result = {}
if type(defaults) == "table" and M.table_size(defaults) == 0 and type(overrides) == "table" then
return overrides
end
for key, value in pairs(defaults) do
if type(value) == "table" then
result[key] = M.merge(value, overrides[key] or {})
else
result[key] = overrides[key] or value
end
end
return result
return vim.tbl_deep_extend("force", defaults, overrides)
end
M.join = function(tbl, separator)