File tree 2 files changed +6
-3
lines changed
2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change 43
43
--- @param tags ? string | string[]
44
44
function OrgMappings :set_tags (tags )
45
45
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 )
47
48
48
49
if not tags then
49
50
tags = utils .input (' Tags: ' , current_tags , function (arg_lead )
Original file line number Diff line number Diff line change @@ -254,11 +254,13 @@ end
254
254
255
255
function utils .tags_to_string (taglist , sorted )
256
256
local tags = ' '
257
+ local tags_list = taglist
257
258
if # taglist > 0 then
258
259
if sorted then
259
- table.sort (taglist )
260
+ tags_list = vim .deepcopy (taglist )
261
+ table.sort (tags_list )
260
262
end
261
- tags = ' :' .. table.concat (taglist , ' :' ) .. ' :'
263
+ tags = ' :' .. table.concat (tags_list , ' :' ) .. ' :'
262
264
end
263
265
return tags
264
266
end
You can’t perform that action at this time.
0 commit comments