Skip to content

Commit

Permalink
fix(config): make ctags and workspace opt overwriteable (#44)
Browse files Browse the repository at this point in the history
  • Loading branch information
KortanZ committed Apr 18, 2024
1 parent 9e8a893 commit f731331
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions lua/gentags/configs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -139,26 +139,7 @@ end
--- @param opts gentags.Options?
--- @return gentags.Options
M.setup = function(opts)
local user_ctags = tbl.tbl_get(opts, "ctags") or {}
local ctags_opts = vim.deepcopy(Defaults.ctags)
for _, o in ipairs(user_ctags) do
if str.not_empty(o) then
table.insert(ctags_opts, o)
end
end

local user_workspace = tbl.tbl_get(opts, "workspace") or {}
local workspace_opts = vim.deepcopy(Defaults.workspace)
for _, o in ipairs(user_workspace) do
if str.not_empty(o) then
table.insert(workspace_opts, o)
end
end

Configs = vim.tbl_deep_extend("force", vim.deepcopy(Defaults), opts or {})
Configs.ctags = ctags_opts
Configs.workspace = workspace_opts

return Configs
end

Expand Down

0 comments on commit f731331

Please sign in to comment.