فهرست منبع

Temporarily change shellredir (#159)

Junegunn Choi 10 سال پیش
والد
کامیت
76bce26ab8
1فایلهای تغییر یافته به همراه3 افزوده شده و 3 حذف شده
  1. 3 3
      plug.vim

+ 3 - 3
plug.vim

@@ -1665,14 +1665,14 @@ endfunction
 
 
 function! s:system(cmd, ...)
 function! s:system(cmd, ...)
   try
   try
-    let sh = &shell
+    let [sh, shrd] = [&shell, &shellredir]
     if !s:is_win
     if !s:is_win
-      set shell=sh
+      set shell=sh shellredir=>%s\ 2>&1
     endif
     endif
     let cmd = a:0 > 0 ? s:with_cd(a:cmd, a:1) : a:cmd
     let cmd = a:0 > 0 ? s:with_cd(a:cmd, a:1) : a:cmd
     return system(s:is_win ? '('.cmd.')' : cmd)
     return system(s:is_win ? '('.cmd.')' : cmd)
   finally
   finally
-    let &shell = sh
+    let [&shell, &shellredir] = [sh, shrd]
   endtry
   endtry
 endfunction
 endfunction