From 340516158097f18b17570b1961c17e20a0d52cd5 Mon Sep 17 00:00:00 2001 From: Oleksandr Smirnov Date: Sun, 2 Mar 2025 17:16:41 +0200 Subject: [PATCH] fix(struct_tags): as it turns out it didnt work as i supposed to before, but now it does --- lua/gopher/struct_tags.lua | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/lua/gopher/struct_tags.lua b/lua/gopher/struct_tags.lua index 4207dae..703b296 100644 --- a/lua/gopher/struct_tags.lua +++ b/lua/gopher/struct_tags.lua @@ -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