mirror of
https://github.com/Ascyii/telekasten.nvim.git
synced 2026-01-01 06:14:23 -05:00
fix: bug with uuid and subdir
This ensures the UUID is placed before the _filename_ part and not before the _subdir_ part if the title of the new file is specified as `subdir/myfile`
This commit is contained in:
@@ -200,10 +200,15 @@ local function get_uuid(opts)
|
||||
end
|
||||
|
||||
local function generate_note_filename(uuid, title)
|
||||
local pp = Path:new(title)
|
||||
local p_splits = pp:_split()
|
||||
local filename = p_splits[#p_splits]
|
||||
local subdir = title:gsub(filename, "")
|
||||
|
||||
local sep = M.Cfg.uuid_sep or "-"
|
||||
if M.Cfg.new_note_filename ~= "uuid" and #title > 0 then
|
||||
if M.Cfg.new_note_filename == "uuid-title" then
|
||||
return uuid .. sep .. title
|
||||
return subdir .. uuid .. sep .. filename
|
||||
elseif M.Cfg.new_note_filename == "title-uuid" then
|
||||
return title .. sep .. uuid
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user