Skip to content

Commit

Permalink
Fix behavior in Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
djmoch committed Dec 8, 2016
1 parent c559207 commit d043ec6
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions plugin/makejob.vim
Original file line number Diff line number Diff line change
Expand Up @@ -103,14 +103,24 @@ function! s:MakeJob(grep, lmake, grepadd, bang, ...)
endif
" Need to check for whitespace inputs as well as no input
if a:0 && (a:1 != '')
let l:trimmed_arg = substitute(a:1, '^\s\+\|\s\+$', '', 'g')
let l:arg = substitute(a:1, '^\s\+\|\s\+$', '', 'g')

" Fix wonky Ex shell escape in Windows to work like :make
if l:arg =~ '^\\"' && (has('win32') || has('win64'))
let l:arg = substitute(l:arg, '\\"', '"', 'g')
let l:arg = substitute(l:arg, '\\ ', ' ', 'g')
endif

if l:internal_grep
let l:make = 'vimgrep '.l:trimmed_arg
let l:make = 'vimgrep '.l:arg
elseif l:make =~ '\$\*'
let l:make = [&shell, &shellcmdflag, substitute(l:make, '\$\*', l:trimmed_arg, 'g')]
let l:make = substitute(l:make, '\$\*', l:arg, 'g')
else
let l:make = [&shell, &shellcmdflag, l:make.' '.l:trimmed_arg]
let l:make = l:make.' '.l:arg
endif

if a:grep
let l:make = [&shell, &shellcmdflag, l:make]
endif
endif

Expand Down

0 comments on commit d043ec6

Please sign in to comment.