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 | |
parent | Merge branch 'release/v1.2.0' (diff) | |
parent | Bump VERSION (diff) | |
download | vim-make-target-384115dabd0d3233dbd63c73f43fa84a6f80a8c6.tar.gz vim-make-target-384115dabd0d3233dbd63c73f43fa84a6f80a8c6.zip |
* release/v1.3.0:
Remove unneeded variable scoping
Switch to two-spacing
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | VERSION | 2 | ||||
-rw-r--r-- | after/ftplugin/make/target.vim | 2 | ||||
-rw-r--r-- | autoload/make/target.vim | 20 | ||||
-rw-r--r-- | doc/make_target.txt | 6 |
5 files changed, 16 insertions, 16 deletions
@@ -8,7 +8,7 @@ function `make#target#Make()` and buffer-local mapping `<Plug>(MakeTarget)` to License ------- -Copyright (c) [Tom Ryder][1]. Distributed under the same terms as Vim itself. +Copyright (c) [Tom Ryder][1]. Distributed under the same terms as Vim itself. See `:help license`. [1]: https://sanctum.geek.nz/ @@ -1 +1 @@ -1.2.0 +1.3.0 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 diff --git a/doc/make_target.txt b/doc/make_target.txt index b57b836..8338e34 100644 --- a/doc/make_target.txt +++ b/doc/make_target.txt @@ -8,8 +8,8 @@ function `make#target#Make()` and buffer-local mapping `<Plug>(MakeTarget)` to REQUIREMENTS *make_target-requirements* -This plugin is only available if 'compatible' is not set. It requires Vim 7.0 -or newer. It won't load at all if you have `g:no_plugin_maps` or +This plugin is only available if 'compatible' is not set. It requires Vim 7.0 +or newer. It won't load at all if you have `g:no_plugin_maps` or `g:no_make_maps` set. MAPPINGS *make_target-mappings* @@ -29,7 +29,7 @@ FUNCTIONS *make_target-functions* *make#target#Make()* The |autoload| function used by |<Plug>(MakeTarget)| is accessible as -`make#target#Make()` if wanted. It's hardcoded to look for the target under +`make#target#Make()` if wanted. It's hardcoded to look for the target under the cursor. AUTHOR *make_target-author* |