refacotred and split

This commit is contained in:
2026-02-25 15:32:05 +01:00
parent d4ad71543d
commit caf21ab060
10 changed files with 207 additions and 157 deletions

View File

@@ -10,7 +10,7 @@ function denote#meta#fileFromNoteId(noteId)
" (A) First, we get all files that contain the note id as substring.
" (B) Then we ensure that the note id is followed by another field or by the
" file extension.
let files = glob(t:denote_directory .. "*" .. a:noteId .. "*", 0, v:true)
let files = glob(g:denote_directory .. "/*" .. a:noteId .. "*", 0, v:true)
\ ->filter('v:val->split("/")[-1] =~ "' .. a:noteId .. '\\(==\\|--\\|__\\|\\.\\)"')
\ ->filter('v:val->split("/")[-1] =~ "^' .. a:noteId .. '\\|@@' .. a:noteId .. '"')
return empty(files) ? v:false : files[0]