Skip to content

Instantly share code, notes, and snippets.

@thinca
Created September 3, 2009 02:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thinca/180086 to your computer and use it in GitHub Desktop.
Save thinca/180086 to your computer and use it in GitHub Desktop.
Index: sexe.vim
===================================================================
--- sexe.vim (リビジョン 518)
+++ sexe.vim (作業コピー)
@@ -40,10 +40,21 @@
function! vimshell#internal#sexe#execute(program, args, fd, other_info)"{{{
" Execute shell command.
let l:cmdline = ''
+ let l:iswin = has('win32') || has('win64')
for arg in a:args
- let l:cmdline .= substitute(arg, '"', '\\""', 'g') . ' '
+ if l:iswin
+ let l:arg = substitute(arg, '"', '\\"', 'g')
+ let l:arg = substitute(arg, '[<>|^]', '^\0', 'g')
+ let l:cmdline .= '"' . arg . '" '
+ else
+ let l:cmdline .= shellescape(arg) . ' '
+ endif
endfor
+ if l:iswin
+ let l:cmdline = '"' . l:cmdline . '"'
+ endif
+
" Set redirection.
if a:fd.stdin == ''
let l:stdin = ''
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment