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

@@ -51,8 +51,13 @@ endfunction
" Load all references to the given note into the location list.
function denote#loclist#references(noteId)
if !exists('t:denote_directory')
echohl WarningMsg
echom "Denote directory not specified, see |vim-denote|."
return
endif
" Populate location list
execute "lvimgrep /\\<denote:" .. a:noteId .. "\\>/gj *"
silent! execute "lvimgrep /\\<denote:" .. a:noteId .. "\\>/gj " .. t:denote_directory .. "*"
" Adjust location list: set title and specify display function
let file=denote#meta#fileFromNoteId(a:noteId)
let noteTitle=denote#meta#noteTitleFromFile(file)