Whoops, fix args

Fri, 20 Aug 2021 02:30:00 -0400

author
Meredith Howard <mhoward@roomag.org>
date
Fri, 20 Aug 2021 02:30:00 -0400
changeset 940
fb5519032710
parent 939
b769704bb258
child 941
fb38620af446

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')
 

mercurial