···5555 table.insert(cmd_args, v)
5656 end
57575858- -- set default tag for "clear tags"
5959- if #arg == 1 and arg[1] ~= "-clear-tags" then
6060- table.insert(cmd_args, "json")
6161- end
6262-6358 local rs = r.sync {
6459 c.commands.gomodifytags,
6560 "-transform",
···999410095-- add tags to struct under cursor
10196function struct_tags.add(...)
102102- local arg = { ... }
103103- if #arg == nil or arg == "" then
104104- arg = { "json" }
9797+ local user_tags = { ... }
9898+ if #user_tags == 0 then
9999+ vim.print("c.gotag.default_tag", c.gotag.default_tag)
100100+ user_tags = { c.gotag.default_tag }
105101 end
106102107103 local cmd_args = { "-add-tags" }
108108- for _, v in ipairs(arg) do
104104+ for _, v in ipairs(user_tags) do
109105 table.insert(cmd_args, v)
110106 end
111107···114110115111-- remove tags to struct under cursor
116112function struct_tags.remove(...)
117117- local arg = { ... }
118118- if #arg == nil or arg == "" then
119119- arg = { "json" }
113113+ local user_tags = { ... }
114114+ if #user_tags == 0 then
115115+ user_tags = { c.gotag.default_tag }
120116 end
121117122118 local cmd_args = { "-remove-tags" }
123123- for _, v in ipairs(arg) do
119119+ for _, v in ipairs(user_tags) do
124120 table.insert(cmd_args, v)
125121 end
126122