diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2019-05-12 16:12:11 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2019-05-12 16:12:11 +1200 |
commit | 384115dabd0d3233dbd63c73f43fa84a6f80a8c6 (patch) | |
tree | 8c1560098d9ac5d89d67afffe5e5cfdd21b2fb73 /autoload | |
parent | Merge branch 'release/v1.2.0' (diff) | |
parent | Bump VERSION (diff) | |
download | vim-make-target-master.tar.gz vim-make-target-master.zip |
* release/v1.3.0:
Remove unneeded variable scoping
Switch to two-spacing
Diffstat (limited to 'autoload')
-rw-r--r-- | autoload/make/target.vim | 20 |
1 files changed, 10 insertions, 10 deletions
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 |