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