mirror of
https://github.com/Ascyii/telekasten.nvim.git
synced 2026-01-01 06:14:23 -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
|
end
|
||||||
|
|
||||||
local function get_uuid(opts)
|
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
|
opts.uuid_type = opts.uuid_type or M.Cfg.uuid_type
|
||||||
|
|
||||||
local uuid
|
local uuid
|
||||||
if opts.prefix_title_by_uuid then
|
|
||||||
if opts.uuid_type ~= "rand" then
|
if opts.uuid_type ~= "rand" then
|
||||||
uuid = os.date(opts.uuid_type)
|
uuid = os.date(opts.uuid_type)
|
||||||
else
|
else
|
||||||
uuid = random_variable(6)
|
uuid = random_variable(6)
|
||||||
end
|
end
|
||||||
end
|
|
||||||
return uuid
|
return uuid
|
||||||
end
|
end
|
||||||
|
|
||||||
local function concat_uuid_title(uuid, title)
|
local function concat_uuid_title(uuid, title)
|
||||||
local sep = M.Cfg.uuid_sep or "-"
|
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
|
return title
|
||||||
else
|
else
|
||||||
return uuid .. sep .. title
|
return uuid .. sep .. title
|
||||||
|
|||||||
Reference in New Issue
Block a user