From c68ed594820582bf48d16358b618b64d2ec94460 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Wed, 29 May 2019 01:36:30 +1200 Subject: Use local variable for filename and readability --- autoload/shebang_create_exec.vim | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/autoload/shebang_create_exec.vim b/autoload/shebang_create_exec.vim index 60d2276..60e24a6 100644 --- a/autoload/shebang_create_exec.vim +++ b/autoload/shebang_create_exec.vim @@ -30,10 +30,13 @@ function! s:Run(filename) abort return endif + " 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 a:filename ==# b:shebang_create_exec_filename - call s:MakeExecutable(b:shebang_create_exec_filename) + if l:filename ==# b:shebang_create_exec_filename + call s:MakeExecutable(filename) endif " Clear away the save filename, even if we didn't change any permissions -- cgit v1.2.3 From 65f78c06cadf53eb68b1e06cf62cf01a99fa302b Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Wed, 29 May 2019 01:37:13 +1200 Subject: Add file existence check before making executable --- autoload/shebang_create_exec.vim | 7 ++++--- 1 file 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 -- cgit v1.2.3 From 1ac927c02d1c9f5224ffbc0be132c4d15e4e2e33 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Wed, 29 May 2019 01:37:42 +1200 Subject: Bump VERSION --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 7dea76e..9084fa2 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.0.1 +1.1.0 -- cgit v1.2.3