diff options
-rw-r--r-- | autoload/shebang_create_exec.vim | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/autoload/shebang_create_exec.vim b/autoload/shebang_create_exec.vim index 60e24a6..cfd08f5 100644 --- a/autoload/shebang_create_exec.vim +++ b/autoload/shebang_create_exec.vim @@ -33,9 +33,10 @@ function! s:Run(filename) abort " Get argument filename into local variable let filename = a:filename - " Check that it matches the file we just saved, and if so, make that file - " executable - if l:filename ==# b:shebang_create_exec_filename + " Check that it matches the file we just saved, and that the file exists, + " and if so, attempt to make it executable + if filename ==# b:shebang_create_exec_filename + \ && filereadable(filename) call s:MakeExecutable(filename) endif |