aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2019-05-12 16:11:32 +1200
committerTom Ryder <tom@sanctum.geek.nz>2019-05-12 16:11:32 +1200
commitfe6b99bd378b00db11975a95c525f19a5645e88a (patch)
tree1a237b51c22f70a073347f06c895794278eae1f9
parentSwitch to two-spacing (diff)
downloadvim-make-target-fe6b99bd378b00db11975a95c525f19a5645e88a.tar.gz
vim-make-target-fe6b99bd378b00db11975a95c525f19a5645e88a.zip
Remove unneeded variable scoping
-rw-r--r--after/ftplugin/make/target.vim2
-rw-r--r--autoload/make/target.vim20
2 files changed, 11 insertions, 11 deletions
diff --git a/after/ftplugin/make/target.vim b/after/ftplugin/make/target.vim
index 57c23d2..b3015a7 100644
--- a/after/ftplugin/make/target.vim
+++ b/after/ftplugin/make/target.vim
@@ -12,7 +12,7 @@ if exists('b:did_ftplugin_make_target')
endif
" Stop here if the user doesn't want ftplugin mappings
-if exists('g:no_plugin_maps') || exists('g:no_make_maps')
+if exists('no_plugin_maps') || exists('no_make_maps')
finish
endif
diff --git a/autoload/make/target.vim b/autoload/make/target.vim
index 1f16801..87d926a 100644
--- a/autoload/make/target.vim
+++ b/autoload/make/target.vim
@@ -2,34 +2,34 @@
function! make#target#Make() abort
" Declare list of targets to build
- let l:targets = []
+ let targets = []
" Iterate back through the file starting at the current line looking for the
" line with the target
- for l:li in reverse(range(1, line('.')))
- let l:line = getline(l:li)
+ for li in reverse(range(1, line('.')))
+ let line = getline(li)
" If it matches the target format, we've found our line; split the targets
" by space, and break
- let l:matchlist = matchlist(l:line, '^\([^:= \t][^:=]*\):')
- if len(l:matchlist)
- let l:targets = split(l:matchlist[1], '\s\+')
+ let matchlist = matchlist(line, '^\([^:= \t][^:=]*\):')
+ if len(matchlist)
+ let targets = split(matchlist[1], '\s\+')
break
" If it wasn't the target line and doesn't have leading tabs, we're not in
" a recipe block; break with an unset target
- elseif strpart(l:line, 0, 1) !=# "\t"
+ elseif strpart(line, 0, 1) !=# "\t"
break
endif
endfor
" If we found targets, :make them; escape them if we can
- for l:target in l:targets
+ for target in targets
if exists('*shellescape')
- let l:target = shellescape(l:target)
+ let target = shellescape(target)
endif
- execute 'make! -C %:p:h '.l:target
+ execute 'make! -C %:p:h '.target
endfor
endfunction