summaryrefslogtreecommitdiff
path: root/autoload
diff options
context:
space:
mode:
authorHolden <holden@axoni.com>2018-12-07 18:04:28 -0500
committerHolden <holden@axoni.com>2018-12-07 18:04:28 -0500
commitcbc029b2b832e6d70d95e6cf810ab6252b42e643 (patch)
tree513430237452e136d23ade25bdf150b29ee00bd0 /autoload
parent1d4f98553852499e0f8ebd951db6ada2b1d973e3 (diff)
downloadale-cbc029b2b832e6d70d95e6cf810ab6252b42e643.zip
Add initial support for settings to overwrite ale shell
Diffstat (limited to 'autoload')
-rw-r--r--autoload/ale/job.vim12
1 files changed, 9 insertions, 3 deletions
diff --git a/autoload/ale/job.vim b/autoload/ale/job.vim
index 0117c7dd..d4771842 100644
--- a/autoload/ale/job.vim
+++ b/autoload/ale/job.vim
@@ -11,6 +11,12 @@
" A setting for wrapping commands.
let g:ale_command_wrapper = get(g:, 'ale_command_wrapper', '')
+" A setting for the shell used to execute commands
+let g:ale_shell = get(g:, 'ale_shell', &shell)
+
+" A setting for the arguments we pass to the shell when executing commands
+let g:ale_shell_arguments = get(g:, 'ale_shell_arguments', &shellcmdflag)
+
if !has_key(s:, 'job_map')
let s:job_map = {}
endif
@@ -188,11 +194,11 @@ function! ale#job#PrepareCommand(buffer, command) abort
return 'cmd /s/c "' . l:command . '"'
endif
- if &shell =~? 'fish$\|pwsh$'
- return ['/bin/sh', '-c', l:command]
+ if g:ale_shell =~? 'fish$\|pwsh$'
+ return ['/bin/sh', g:ale_shell_arguments, l:command]
endif
- return split(&shell) + split(&shellcmdflag) + [l:command]
+ return [g:ale_shell] + split(g:ale_shell_arguments) + [l:command]
endfunction
" Start a job with options which are agnostic to Vim and NeoVim.