[Neovim] Fix obsidian note_id_func generating only one random char
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
26de8e0076
commit
7af382fcfd
1 file changed
+3
-1
@@ -58,9 +58,11 @@ return {
|
|||||||
return title:gsub("[^A-Za-z0-9-_]", ""):lower()
|
return title:gsub("[^A-Za-z0-9-_]", ""):lower()
|
||||||
else
|
else
|
||||||
-- If title is nil, just put the date and four random characters
|
-- If title is nil, just put the date and four random characters
|
||||||
|
local suffix = ""
|
||||||
for _ = 1, 4 do
|
for _ = 1, 4 do
|
||||||
return os.date("%Y-%m-%d ") .. string.char(math.random(65, 90))
|
suffix = suffix .. string.char(math.random(65, 90))
|
||||||
end
|
end
|
||||||
|
return os.date("%Y-%m-%d") .. "-" .. suffix
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in new issue
Block a user