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 418b222e80369c3e6ac2bd593f4dfdbb49e6d999
parent c5f304a3ff71451a569aa42deb3afad9859d7643
Author: Daniel Moch <daniel@danielmoch.com>
Date:   Sat,  3 Dec 2016 14:17:51 -0500

Handle whitespace in arguments

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

diff --git a/plugin/makejob.vim b/plugin/makejob.vim @@ -1,7 +1,7 @@ " " TITLE: VIM-MAKEJOB " AUTHOR: Daniel Moch <daniel@danielmoch.com> -" VERSION: 1.1 +" VERSION: 1.1.1-dev " if exists('g:loaded_makejob') || version < 800 || !has('job') || \ !has('channel') || !has('quickfix') @@ -96,7 +96,8 @@ function! s:MakeJob(grep, lmake, grepadd, bang, ...) echohl None return endif - if a:0 + " Need to check for whitespace inputs as well as no input + if a:0 && (a:1 != '') if a:grep if internal_grep let make = 'vimgrep '.a:1 @@ -106,7 +107,8 @@ function! s:MakeJob(grep, lmake, grepadd, bang, ...) let make = [&shell, &shellcmdflag, make.' '.a:1] endif else - let make = make.' '.expand(a:1) + let trimmed_arg = substitute(a:1, '^\s\+\|\s\+$', '', 'g') + let make = make.' '.expand(trimmed_arg) end endif