mirror of
https://github.com/Ascyii/telekasten.nvim.git
synced 2026-01-01 14:14:24 -05:00
Merge pull request #129 from ernie/fix-uuid-when-not-in-filename
Fix UUID when not in filename
This commit is contained in:
@@ -191,24 +191,20 @@ local function random_variable(length)
|
||||
end
|
||||
|
||||
local function get_uuid(opts)
|
||||
opts.prefix_title_by_uuid = opts.prefix_title_by_uuid
|
||||
or M.Cfg.prefix_title_by_uuid
|
||||
opts.uuid_type = opts.uuid_type or M.Cfg.uuid_type
|
||||
|
||||
local uuid
|
||||
if opts.prefix_title_by_uuid then
|
||||
if opts.uuid_type ~= "rand" then
|
||||
uuid = os.date(opts.uuid_type)
|
||||
else
|
||||
uuid = random_variable(6)
|
||||
end
|
||||
end
|
||||
return uuid
|
||||
end
|
||||
|
||||
local function concat_uuid_title(uuid, title)
|
||||
local sep = M.Cfg.uuid_sep or "-"
|
||||
if uuid == nil then
|
||||
if uuid == nil or not M.Cfg.prefix_title_by_uuid then
|
||||
return title
|
||||
else
|
||||
return uuid .. sep .. title
|
||||
|
||||
Reference in New Issue
Block a user