From aea1b5322df2a6cb0f4f0bc620105009604c0ddc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=84min=20Baumeler?= Date: Tue, 26 May 2026 09:30:35 +0200 Subject: [PATCH] fixed name of new files --- autoload/libdenote.vim | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/autoload/libdenote.vim b/autoload/libdenote.vim index 92231f8..60e872b 100644 --- a/autoload/libdenote.vim +++ b/autoload/libdenote.vim @@ -10,13 +10,12 @@ " " This function removes illegal characters in parts of the filename. function s:santizefnpart(part) - return a:part->tolower() - \ ->substitute('[^[:alnum:]]', '-', 'g') - \ ->substitute('-\+', '-', 'g') - \ ->substitute('_\+', '_', 'g') - \ ->substitute('=\+', '=', 'g') - \ ->substitute('@\+', '@', 'g') - \ ->trim('-_@=') + return a:part->substitute('[^[:alnum:]]', '-', 'g') + \ ->substitute('-\+', '-', 'g') + \ ->substitute('_\+', '_', 'g') + \ ->substitute('=\+', '=', 'g') + \ ->substitute('@\+', '@', 'g') + \ ->trim('-_@=') endfunction " API {{{2 @@ -40,10 +39,10 @@ endfunction " @argument a:sig string: Signature string of denote entry function libdenote#scheme_filename(ext, identifier, title='', tags=[], sig='') let l:f = s:santizefnpart(a:identifier) - let l:f ..= len(a:sig) > 0 ? ('==' .. s:santizefnpart(a:sig)) : '' - let l:f ..= len(a:title) > 0 ? ('--' .. s:santizefnpart(a:title)) : '' - let l:f ..= len(a:tags) > 0 ? ('__' .. map(copy(a:tags), {_, v -> s:santizefnpart(v)})->join('_')) : '' - return l:f .. '.' .. a:ext + let l:f ..= len(a:sig) > 0 ? ('==' .. s:santizefnpart(a:sig))->tolower() : '' + let l:f ..= len(a:title) > 0 ? ('--' .. s:santizefnpart(a:title))->tolower() : '' + let l:f ..= len(a:tags) > 0 ? ('__' .. map(copy(a:tags), {_, v -> s:santizefnpart(v)})->join('_'))->tolower() : '' + return l:f .. '.' .. a:ext->tolower() endfunction " Retrieve metadata from file name