fixed denote directory support

This commit is contained in:
2026-02-23 13:07:33 +01:00
parent d2d01e83e0
commit ac75a8c679
3 changed files with 14 additions and 22 deletions

View File

@@ -48,7 +48,7 @@ function s:DenoteNotesByTag(tag)
" Clear location list
call denote#loclist#clear()
" Find files
let files = glob(t:denote_directory .. "*_" .. a:tag .. "*", 0, v:true)->filter('v:val =~ "_' .. a:tag .. '\\(==\\|@@\\|__\\|_\\|\\.\\)"')
let files = glob(t:denote_directory .. "*_" .. a:tag .. "*", 0, v:true)->filter('v:val->split("/")[-1] =~ "_' .. a:tag .. '\\(==\\|@@\\|__\\|_\\|\\.\\)"')
" Populate location list
let locTitle="Denote notes: " .. a:tag
call setloclist(0, [], 'r',
@@ -72,10 +72,10 @@ function s:DenoteNotes(search)
echom "Denote directory not specified, see |vim-denote|."
return
endif
let s = substitute(" " .. a:search .. " ", " ", "*", "g")
" Clear location list
call denote#loclist#clear()
" Find files
let s = substitute(" " .. a:search .. " ", " ", "*", "g")
let files = glob(t:denote_directory .. s, 0, v:true)
" Populate location list
let locTitle="Denote notes search:" .. a:search