Clean up the new g:ale_shell code. Use it for Windows

This commit is contained in:
w0rp
2019-01-03 21:23:09 +00:00
parent 7919db0db5
commit 08606b88d0
3 changed files with 55 additions and 60 deletions

View File

@@ -1,10 +1,14 @@
Before:
Save &shell
Save &shellcmdflag
Save g:ale_shell
Save g:ale_shell_arguments
unlet! g:ale_shell
unlet! g:ale_shell_arguments
After:
Restore
let g:ale_shell = v:null
Execute(sh should be used when the shell is fish):
if !has('win32')
@@ -58,8 +62,10 @@ Execute(cmd /s/c as a string should be used on Windows):
endif
Execute(Setting ale_shell should cause ale#job#PrepareCommand to use set shell):
if !has('win32')
let g:ale_shell = '/foo/bar'
let g:ale_shell = '/foo/bar'
AssertEqual ['/foo/bar', '-c', 'foobar'], ale#job#PrepareCommand(bufnr(''), "foobar")
endif
AssertEqual ['/foo/bar', '-c', 'foobar'], ale#job#PrepareCommand(bufnr(''), "foobar")
let g:ale_shell_arguments = '-x'
AssertEqual ['/foo/bar', '-x', 'foobar'], ale#job#PrepareCommand(bufnr(''), "foobar")