aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--VERSION2
-rw-r--r--autoload/shebang_create_exec.vim12
2 files changed, 9 insertions, 5 deletions
diff --git a/VERSION b/VERSION
index 7dea76e..9084fa2 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-1.0.1
+1.1.0
diff --git a/autoload/shebang_create_exec.vim b/autoload/shebang_create_exec.vim
index 60d2276..cfd08f5 100644
--- a/autoload/shebang_create_exec.vim
+++ b/autoload/shebang_create_exec.vim
@@ -30,10 +30,14 @@ function! s:Run(filename) abort
return
endif
- " Check that it matches the file we just saved, and if so, make that file
- " executable
- if a:filename ==# b:shebang_create_exec_filename
- call s:MakeExecutable(b:shebang_create_exec_filename)
+ " Get argument filename into local variable
+ let filename = a: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
" Clear away the save filename, even if we didn't change any permissions