fix(struct_tags): as it turns out it didnt work as i supposed to before, but now it does

This commit is contained in:
Oleksandr Smirnov 2025-03-02 17:16:41 +02:00
parent 9fcff3bb2a
commit 3405161580
No known key found for this signature in database

View file

@ -94,13 +94,14 @@ end
-- add tags to struct under cursor
function struct_tags.add(...)
local arg = { ... }
if #arg == nil or arg == "" then
arg = { c.gotag.default_tag }
local user_tags = { ... }
if #user_tags == 0 then
vim.print("c.gotag.default_tag", c.gotag.default_tag)
user_tags = { c.gotag.default_tag }
end
local cmd_args = { "-add-tags" }
for _, v in ipairs(arg) do
for _, v in ipairs(user_tags) do
table.insert(cmd_args, v)
end
@ -109,13 +110,13 @@ end
-- remove tags to struct under cursor
function struct_tags.remove(...)
local arg = { ... }
if #arg == nil or arg == "" then
arg = { c.gotag.default_tag }
local user_tags = { ... }
if #user_tags == 0 then
user_tags = { c.gotag.default_tag }
end
local cmd_args = { "-remove-tags" }
for _, v in ipairs(arg) do
for _, v in ipairs(user_tags) do
table.insert(cmd_args, v)
end