aboutsummaryrefslogtreecommitdiff
path: root/autoload/prettier.vim
diff options
context:
space:
mode:
authormitermayer <mitermayer.reis@gmail.com>2017-08-24 08:50:42 -0700
committermitermayer <mitermayer.reis@gmail.com>2017-08-24 08:50:42 -0700
commit72e81c68d3dc10126cc29975f6ac381c3493625c (patch)
treef3b9c782d939fecac4d21bdd46d62765163b4784 /autoload/prettier.vim
parentf86f1511461dc677f3b128f49a39496b4f7eaf2c (diff)
downloadvim-prettier-72e81c68d3dc10126cc29975f6ac381c3493625c.tar.xz
Async command was not working for windows this patch will make sure it
works for normal shells
Diffstat (limited to 'autoload/prettier.vim')
-rw-r--r--autoload/prettier.vim8
1 files changed, 7 insertions, 1 deletions
diff --git a/autoload/prettier.vim b/autoload/prettier.vim
index bfbd54a..543b543 100644
--- a/autoload/prettier.vim
+++ b/autoload/prettier.vim
@@ -71,9 +71,15 @@ function! s:Prettier_Exec_Sync(cmd, startSelection, endSelection) abort
endfunction
function! s:Prettier_Exec_Async(cmd, startSelection, endSelection) abort
+ let l:async_cmd = a:cmd
+
+ if has('win32') || has('win64')
+ let l:async_cmd = 'cmd.exe /c ' . a:cmd
+ endif
+
if s:prettier_job_running != 1
let s:prettier_job_running = 1
- call job_start(a:cmd, {
+ call job_start(l:async_cmd, {
\ 'in_io': 'buffer',
\ 'in_top': a:startSelection,
\ 'in_bot': a:endSelection,