Fri, 20 Aug 2021 02:30:00 -0400
Whoops, fix args
.vim/autoload/vimrc.vim | file | annotate | diff | comparison | revisions | |
.vimrc | file | annotate | diff | comparison | revisions |
--- a/.vim/autoload/vimrc.vim +++ b/.vim/autoload/vimrc.vim @@ -105,9 +105,9 @@ END_PERL endfunc endif -func! vimrc#PrepDir(path, prune_days) abort - if !filewritable(path) - call mkdir(path, 'p', 0700) +func! vimrc#PrepDir(path) abort + if !filewritable(a:path) + call mkdir(a:path, 'p', 0700) endif endfunc @@ -116,8 +116,8 @@ func! vimrc#PruneFiles(path, days) abort if isdirectory(l:path) for file in split(globpath(l:path, "*"), "\n") if localtime() > getftime(file) + 86400 * a:days - delete(file) != 0 + call delete(file) endif endfor - else + endif endfunc
--- a/.vimrc +++ b/.vimrc @@ -243,7 +243,7 @@ runtime macros/matchit.vim for subdir in ['backup', 'tmp', 'undo'] call vimrc#PrepDir(g:vimcache . '/' . subdir) - call vimrc#PruneFiles(g:vimcache . '/' . subdir) + call vimrc#PruneFiles(g:vimcache . '/' . subdir, 60) endfor call vimrc#PrepDir(g:vimcache . '/session')