mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-08 05:24:46 +08:00
#2009 - Force Windows jobs to run in a CMD shell
This commit is contained in:
@@ -293,6 +293,8 @@ function! ale#command#Run(buffer, command, Callback, options) abort
|
|||||||
let s:fake_job_id = get(s:, 'fake_job_id', 0) + 1
|
let s:fake_job_id = get(s:, 'fake_job_id', 0) + 1
|
||||||
let l:job_id = s:fake_job_id
|
let l:job_id = s:fake_job_id
|
||||||
endif
|
endif
|
||||||
|
elseif has('win32')
|
||||||
|
let l:job_id = ale#job#StartWithCmd(l:command, l:job_options)
|
||||||
else
|
else
|
||||||
let l:job_id = ale#job#Start(l:command, l:job_options)
|
let l:job_id = ale#job#Start(l:command, l:job_options)
|
||||||
endif
|
endif
|
||||||
|
|||||||
@@ -276,6 +276,24 @@ function! ale#job#Start(command, options) abort
|
|||||||
return l:job_id
|
return l:job_id
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
" Force running commands in a Windows CMD command line.
|
||||||
|
" This means the same command syntax works everywhere.
|
||||||
|
function! ale#job#StartWithCmd(command, options) abort
|
||||||
|
let l:shell = &l:shell
|
||||||
|
let l:shellcmdflag = &l:shellcmdflag
|
||||||
|
let &l:shell = 'cmd'
|
||||||
|
let &l:shellcmdflag = '/c'
|
||||||
|
|
||||||
|
try
|
||||||
|
let l:job_id = ale#job#Start(a:command, a:options)
|
||||||
|
finally
|
||||||
|
let &l:shell = l:shell
|
||||||
|
let &l:shellcmdflag = l:shellcmdflag
|
||||||
|
endtry
|
||||||
|
|
||||||
|
return l:job_id
|
||||||
|
endfunction
|
||||||
|
|
||||||
" Send raw data to the job.
|
" Send raw data to the job.
|
||||||
function! ale#job#SendRaw(job_id, string) abort
|
function! ale#job#SendRaw(job_id, string) abort
|
||||||
if has('nvim')
|
if has('nvim')
|
||||||
|
|||||||
@@ -331,7 +331,12 @@ function! ale#lsp#StartProgram(conn_id, executable, command) abort
|
|||||||
\ 'mode': 'raw',
|
\ 'mode': 'raw',
|
||||||
\ 'out_cb': {_, message -> ale#lsp#HandleMessage(a:conn_id, message)},
|
\ 'out_cb': {_, message -> ale#lsp#HandleMessage(a:conn_id, message)},
|
||||||
\}
|
\}
|
||||||
|
|
||||||
|
if has('win32')
|
||||||
|
let l:job_id = ale#job#StartWithCmd(a:command, l:options)
|
||||||
|
else
|
||||||
let l:job_id = ale#job#Start(a:command, l:options)
|
let l:job_id = ale#job#Start(a:command, l:options)
|
||||||
|
endif
|
||||||
else
|
else
|
||||||
let l:job_id = l:conn.job_id
|
let l:job_id = l:conn.job_id
|
||||||
endif
|
endif
|
||||||
|
|||||||
Reference in New Issue
Block a user