]> git.phdru.name Git - dotfiles.git/blobdiff - .vimrc
.vimrc: Fix checktime/FileChangedShell
[dotfiles.git] / .vimrc
diff --git a/.vimrc b/.vimrc
index 1620a5d40ad0b78cd52e498f9a6807d38dbfce5e..ab3609ebcf5a5d74a35ac9ebe0e1aa7ffcb21b3a 100644 (file)
--- a/.vimrc
+++ b/.vimrc
@@ -591,7 +591,7 @@ if executable('chmod')
       checktime
       let fname = expand("%:p")
       let fx = executable(fname)
-      execute "au FileChangedShell " . fname . " :echo"
+      execute "au FileChangedShell <buffer> call _BufChangedCB()"
       if a:x && !fx
          !chmod a+x %
       elseif !a:x && fx
@@ -601,7 +601,9 @@ if executable('chmod')
          echoerr 'Error running chmod: ' . v:shell_error
       endif
       checktime
-      execute "au! FileChangedShell " . fname
+   endfunction
+   function! _BufChangedCB()
+      execute "au! FileChangedShell <buffer>"
    endfunction
    command! ToggleXbit if executable(expand("%:p")) | call SetExecutableBit(0) | else | call SetExecutableBit(1) | endif
 endif