vim-makejob

Minimal, asynchronous quickfix commands for Vim 8.0
git clone git://git.danielmoch.com/vim-makejob.git
Log | Files | Refs | README | LICENSE

commit c559207138d5e82717be775ed6172a9ee080a368
parent 086ad91585b2e2b3285385f95a2631e65a92d9a8
Author: Daniel Moch <daniel@danielmoch.com>
Date:   Tue,  6 Dec 2016 20:14:24 -0500

More minor fixes to enhance expansion robustness

Diffstat:
Mplugin/makejob.vim | 19++++++++-----------
1 file changed, 8 insertions(+), 11 deletions(-)

diff --git a/plugin/makejob.vim b/plugin/makejob.vim @@ -81,7 +81,7 @@ function! s:Expand(input) let l:split_input = split(a:input) let l:expanded_input = [] for l:token in l:split_input - if l:token != '$*' && expand(l:token) != '' + if l:token =~ '^%\|^#\|^\$' && l:token != '$*' && expand(l:token) != '' let l:expanded_input += [expand(l:token)] else let l:expanded_input += [l:token] @@ -103,17 +103,14 @@ function! s:MakeJob(grep, lmake, grepadd, bang, ...) endif " Need to check for whitespace inputs as well as no input if a:0 && (a:1 != '') - if a:grep - if l:internal_grep - let l:make = 'vimgrep '.a:1 - elseif l:make =~ '\$\*' - let l:make = [&shell, &shellcmdflag, substitute(l:make, '\$\*', a:1, 'g')] - else - let l:make = [&shell, &shellcmdflag, l:make.' '.a:1] - endif + let l:trimmed_arg = substitute(a:1, '^\s\+\|\s\+$', '', 'g') + + if l:internal_grep + let l:make = 'vimgrep '.l:trimmed_arg + elseif l:make =~ '\$\*' + let l:make = [&shell, &shellcmdflag, substitute(l:make, '\$\*', l:trimmed_arg, 'g')] else - let l:trimmed_arg = substitute(a:1, '^\s\+\|\s\+$', '', 'g') - let l:make = l:make.' '.expand(l:trimmed_arg) + let l:make = [&shell, &shellcmdflag, l:make.' '.l:trimmed_arg] endif endif