Skip to content

Commit

Permalink
Handle whitespace in arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
djmoch committed Dec 3, 2016
1 parent c5f304a commit 418b222
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions plugin/makejob.vim
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"
" TITLE: VIM-MAKEJOB
" AUTHOR: Daniel Moch <[email protected]>
" VERSION: 1.1
" VERSION: 1.1.1-dev
"
if exists('g:loaded_makejob') || version < 800 || !has('job') ||
\ !has('channel') || !has('quickfix')
Expand Down Expand Up @@ -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
Expand All @@ -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

Expand Down

0 comments on commit 418b222

Please sign in to comment.