Skip to content

Commit

Permalink
vimproc.vim: update
Browse files Browse the repository at this point in the history
  • Loading branch information
lilydjwg committed Dec 11, 2014
1 parent b533a0c commit 953e078
Show file tree
Hide file tree
Showing 10 changed files with 443 additions and 243 deletions.
468 changes: 283 additions & 185 deletions autoload/vimproc.vim

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions autoload/vimproc/cmd.vim
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ set cpo&vim
" }}}

if !vimproc#util#is_windows()
function! vimproc#cmd#system(expr)
return vimproc#system(a:expr)
endfunction
let &cpo = s:save_cpo
finish
endif

Expand Down
10 changes: 7 additions & 3 deletions autoload/vimproc/filepath.vim
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ function! s:path_extensions()
" get default PATHEXT
let pathext = matchstr(system('set pathext'), '^pathext=\zs.*\ze\n', 'i')
endif
let s:path_extensions = map(split(pathext, s:path_separator), 'tolower(v:val)')
let s:path_extensions = split(tolower(pathext), s:path_separator)
elseif s:is_cygwin
" cygwin is not use $PATHEXT
let s:path_extensions = ['', '.exe']
Expand All @@ -57,7 +57,11 @@ endfunction
function! s:which(command, ...)
let maxcount = (a:0 >= 2 && type(a:2) == type(0)) ? a:2 : 1
if maxcount == 1 && exists('*exepath')
return exepath(a:command)
let full = exepath(a:command)
if s:is_windows && (full =~? '\.lnk$') && (getftype(full) ==# 'file')
return resolve(full)
endif
return full
endif
let pathlist = a:command =~# s:path_sep_pattern ? [''] :
\ !a:0 ? split($PATH, s:path_separator) :
Expand All @@ -76,7 +80,7 @@ function! s:which(command, ...)
let head = dir ==# '' ? '' : dir . dirsep
for ext in pathext
let full = fnamemodify(head . a:command . ext, ':p')
if getftype(full) ==# 'link' && s:is_windows
if s:is_windows && (full =~? '\.lnk$') && (getftype(full) ==# 'file')
let full = resolve(full)
endif

Expand Down
16 changes: 10 additions & 6 deletions autoload/vimproc/parser.vim
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ function! vimproc#parser#parse_statements(script) "{{{

let statement .= '\' . script[i]
let i += 1
elseif script[i] == '#'
elseif script[i] == '#' && statement == ''
" Comment.
break
else
Expand Down Expand Up @@ -231,7 +231,7 @@ function! vimproc#parser#split_args(script) "{{{

let arg .= script[i]
let i += 1
elseif script[i] == '#'
elseif script[i] == '#' && arg == ''
" Comment.
break
elseif script[i] != ' '
Expand Down Expand Up @@ -874,20 +874,22 @@ function! s:skip_single_quote(script, i) "{{{
let string .= a:script[i]
let i += 1

let ss = []
while i < max
if a:script[i] == ''''
if i+1 < max && a:script[i+1] == ''''
" Escape quote.
let string .= a:script[i]
let ss += [a:script[i]]
let i += 1
else
break
endif
endif

let string .= a:script[i]
let ss += [a:script[i]]
let i += 1
endwhile
let string .= join(ss, '')

if i < max
" must end with "'"
Expand All @@ -912,20 +914,22 @@ function! s:skip_double_quote(script, i) "{{{
let string .= a:script[i]
let i += 1

let ss = []
while i < max
if a:script[i] == '\'
\ && i+1 < max && a:script[i+1] == '"'
" Escape quote.
let string .= a:script[i]
let ss += [a:script[i]]
let i += 1

elseif a:script[i] == '"'
break
endif

let string .= a:script[i]
let ss += [a:script[i]]
let i += 1
endwhile
let string .= join(ss, '')

if i < max
" must end with '"'
Expand Down
7 changes: 6 additions & 1 deletion autoload/vimproc/util.vim
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,13 @@ let s:is_mac = !s:is_windows
\ (!isdirectory('/proc') && executable('sw_vers')))

" iconv() wrapper for safety.
function! vimproc#util#has_iconv() "{{{
" On Windows, some encodings can be converted by iconv() even if
" libiconv.dll is not available.
return (has('iconv') || (s:is_windows && exists('*iconv')))
endfunction"}}}
function! vimproc#util#iconv(expr, from, to) "{{{
if !has('iconv')
if !vimproc#util#has_iconv()
\ || a:expr == '' || a:from == ''
\ || a:to == '' || a:from ==# a:to
return a:expr
Expand Down
Binary file added autoload/vimproc_linux64.so
Binary file not shown.
Binary file removed autoload/vimproc_unix.so
Binary file not shown.
4 changes: 4 additions & 0 deletions doc/tags
Original file line number Diff line number Diff line change
Expand Up @@ -1745,10 +1745,14 @@ vimproc-commands vimproc.txt /*vimproc-commands*
vimproc-contents vimproc.txt /*vimproc-contents*
vimproc-examples vimproc.txt /*vimproc-examples*
vimproc-faq vimproc.txt /*vimproc-faq*
vimproc-file-object vimproc.txt /*vimproc-file-object*
vimproc-functions vimproc.txt /*vimproc-functions*
vimproc-install vimproc.txt /*vimproc-install*
vimproc-interface vimproc.txt /*vimproc-interface*
vimproc-introduction vimproc.txt /*vimproc-introduction*
vimproc-objects vimproc.txt /*vimproc-objects*
vimproc-process-object vimproc.txt /*vimproc-process-object*
vimproc-socket-object vimproc.txt /*vimproc-socket-object*
vimproc-tips vimproc.txt /*vimproc-tips*
vimproc-tips-pseudo-devices vimproc.txt /*vimproc-tips-pseudo-devices*
vimproc-variables vimproc.txt /*vimproc-variables*
Expand Down
Loading

0 comments on commit 953e078

Please sign in to comment.