[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:
2026-07-06 16:17:33 -07:00
parent 26de8e0076
commit 7af382fcfd

View File

@@ -58,9 +58,11 @@ return {
return title:gsub("[^A-Za-z0-9-_]", ""):lower()
else
-- If title is nil, just put the date and four random characters
local suffix = ""
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
return os.date("%Y-%m-%d") .. "-" .. suffix
end
end,
},