Better helper function names for expanding split
This commit is contained in:
parent
e87c612491
commit
2503a957ff
@ -983,12 +983,20 @@ function! s:ExpandSplit(string, ...) abort
|
|||||||
return handle_bar ? [list, ''] : list
|
return handle_bar ? [list, ''] : list
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
function! s:SplitExpand(string, ...) abort
|
||||||
|
return s:ExpandSplit(a:string, 0, a:0 ? a:1 : getcwd())
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! s:SplitExpandChain(string, ...) abort
|
||||||
|
return s:ExpandSplit(a:string, 1, a:0 ? a:1 : getcwd())
|
||||||
|
endfunction
|
||||||
|
|
||||||
function! s:ShellExpand(cmd, ...) abort
|
function! s:ShellExpand(cmd, ...) abort
|
||||||
return s:shellesc(s:ExpandSplit(a:cmd, 0, a:0 ? a:1 : getcwd()))
|
return s:shellesc(s:SplitExpand(a:cmd, a:0 ? a:1 : getcwd()))
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:ShellExpandChain(cmd, ...) abort
|
function! s:ShellExpandChain(cmd, ...) abort
|
||||||
let [args, after] = s:ExpandSplit(a:cmd, 1, a:0 ? a:1 : getcwd())
|
let [args, after] = s:SplitExpandChain(a:cmd, a:0 ? a:1 : getcwd())
|
||||||
return [s:shellesc(args), after]
|
return [s:shellesc(args), after]
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
@ -3026,7 +3034,7 @@ function! s:RebaseEdit(cmd, dir) abort
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:Merge(cmd, bang, mods, args, ...) abort
|
function! s:Merge(cmd, bang, mods, args, ...) abort
|
||||||
let args = s:shellesc(s:ExpandSplit(a:args))
|
let args = s:shellesc(s:SplitExpand(a:args))
|
||||||
let dir = a:0 ? a:1 : s:Dir()
|
let dir = a:0 ? a:1 : s:Dir()
|
||||||
let mods = s:Mods(a:mods)
|
let mods = s:Mods(a:mods)
|
||||||
if a:cmd =~# '^rebase' && ' '.args =~# ' -i\| --interactive'
|
if a:cmd =~# '^rebase' && ' '.args =~# ' -i\| --interactive'
|
||||||
@ -3225,7 +3233,7 @@ function! s:Grep(cmd,bang,arg) abort
|
|||||||
if fugitive#GitVersion(2, 19)
|
if fugitive#GitVersion(2, 19)
|
||||||
let &grepprg .= ' --column'
|
let &grepprg .= ' --column'
|
||||||
endif
|
endif
|
||||||
let args = s:ExpandSplit(a:arg)
|
let args = s:SplitExpand(a:arg)
|
||||||
exe a:cmd.'! '.escape(s:shellesc(args), '|#%')
|
exe a:cmd.'! '.escape(s:shellesc(args), '|#%')
|
||||||
let list = a:cmd =~# '^l' ? getloclist(0) : getqflist()
|
let list = a:cmd =~# '^l' ? getloclist(0) : getqflist()
|
||||||
for entry in list
|
for entry in list
|
||||||
|
Loading…
x
Reference in New Issue
Block a user