feat: denote directory support

This commit is contained in:
2026-02-21 10:13:47 +01:00
parent 6d8f8c720b
commit d2d01e83e0
5 changed files with 103 additions and 16 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("*" .. a:noteId .. "*", 0, v:true)
let files = glob(t:denote_directory .. "*" .. a:noteId .. "*", 0, v:true)
\ ->filter('v:val =~ "' .. a:noteId .. '\\(==\\|--\\|__\\|\\.\\)"')
\ ->filter('v:val =~ "^' .. a:noteId .. '\\|@@' .. a:noteId .. '"')
return empty(files) ? v:false : files[0]