aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2019-05-29 01:36:30 +1200
committerTom Ryder <tom@sanctum.geek.nz>2019-05-29 01:36:30 +1200
commitc68ed594820582bf48d16358b618b64d2ec94460 (patch)
tree13224639c6d5bf44b6e76cd08a873f88a19569b4
parent9caae053c0cf15aed518813eca00d14294df3986 (diff)
downloadvim-shebang-create-exec-c68ed594820582bf48d16358b618b64d2ec94460.tar.gz
vim-shebang-create-exec-c68ed594820582bf48d16358b618b64d2ec94460.zip
Use local variable for filename and readability
-rw-r--r--autoload/shebang_create_exec.vim7
1 files 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