Fix handling of bar in argument parsing

This commit is contained in:
Tim Pope 2019-07-06 13:47:30 -04:00
parent 2fdba349f5
commit a50e072587

View File

@ -973,7 +973,7 @@ function! s:ExpandSplit(string, ...) abort
if handle_bar && string =~# '^\s*|'
return [list, substitute(string, '^\s*', '', '')]
endif
let arg = matchstr(string, '^\s*\%(' . dquote . '''[^'']*''\|\\.\|\S\)\+')
let arg = matchstr(string, '^\s*\%(' . dquote . '''[^'']*''\|\\.\|[^[:space:] ' . (handle_bar ? '|' : '') . ']\)\+')
let string = strpart(string, len(arg))
let arg = substitute(substitute(arg, '^\s\+', '', ''),
\ '\(' . dquote . '''\%(''''\|[^'']\)*''\|\\[' . s:fnameescape . ']\|^\\[>+-]\|!\d*\)\|' . s:expand,