File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed
Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change 4343--- @param tags ? string | string[]
4444function OrgMappings :set_tags (tags )
4545 local headline = self .files :get_closest_headline ()
46- local current_tags = utils .tags_to_string (headline :get_own_tags ())
46+ local headline_tags = headline :get_own_tags ()
47+ local current_tags = utils .tags_to_string (headline_tags )
4748
4849 if not tags then
4950 tags = utils .input (' Tags: ' , current_tags , function (arg_lead )
Original file line number Diff line number Diff line change @@ -254,11 +254,13 @@ end
254254
255255function utils .tags_to_string (taglist , sorted )
256256 local tags = ' '
257+ local tags_list = taglist
257258 if # taglist > 0 then
258259 if sorted then
259- table.sort (taglist )
260+ tags_list = vim .deepcopy (taglist )
261+ table.sort (tags_list )
260262 end
261- tags = ' :' .. table.concat (taglist , ' :' ) .. ' :'
263+ tags = ' :' .. table.concat (tags_list , ' :' ) .. ' :'
262264 end
263265 return tags
264266end
You can’t perform that action at this time.
0 commit comments