Add mods support to :Gmerge
This commit is contained in:
parent
de1f8b5a20
commit
a1f9596d2d
@ -2285,11 +2285,11 @@ endfunction
|
|||||||
" Section: :Gmerge, :Grebase, :Gpull
|
" Section: :Gmerge, :Grebase, :Gpull
|
||||||
|
|
||||||
call s:command("-nargs=? -bang -complete=custom,s:RevisionComplete Gmerge " .
|
call s:command("-nargs=? -bang -complete=custom,s:RevisionComplete Gmerge " .
|
||||||
\ "execute s:Merge('merge', <bang>0, <q-args>)")
|
\ "execute s:Merge('merge', <bang>0, '<mods>', <q-args>)")
|
||||||
call s:command("-nargs=? -bang -complete=custom,s:RevisionComplete Grebase " .
|
call s:command("-nargs=? -bang -complete=custom,s:RevisionComplete Grebase " .
|
||||||
\ "execute s:Merge('rebase', <bang>0, <q-args>)")
|
\ "execute s:Merge('rebase', <bang>0, '<mods>', <q-args>)")
|
||||||
call s:command("-nargs=? -bang -complete=custom,s:RemoteComplete Gpull " .
|
call s:command("-nargs=? -bang -complete=custom,s:RemoteComplete Gpull " .
|
||||||
\ "execute s:Merge('pull --progress', <bang>0, <q-args>)")
|
\ "execute s:Merge('pull --progress', <bang>0, '<mods>', <q-args>)")
|
||||||
|
|
||||||
function! s:RevisionComplete(A, L, P) abort
|
function! s:RevisionComplete(A, L, P) abort
|
||||||
return s:TreeChomp('rev-parse', '--symbolic', '--branches', '--tags', '--remotes')
|
return s:TreeChomp('rev-parse', '--symbolic', '--branches', '--tags', '--remotes')
|
||||||
@ -2327,7 +2327,8 @@ let s:common_efm = ''
|
|||||||
\ . '%-G%.%#%\e[K%.%#,'
|
\ . '%-G%.%#%\e[K%.%#,'
|
||||||
\ . '%-G%.%#%\r%.%\+'
|
\ . '%-G%.%#%\r%.%\+'
|
||||||
|
|
||||||
function! s:Merge(cmd, bang, args) abort
|
function! s:Merge(cmd, bang, mods, args) abort
|
||||||
|
let mods = substitute(a:mods, '\C<mods>', '', '') . ' '
|
||||||
if a:cmd =~# '^rebase' && ' '.a:args =~# ' -i\| --interactive\| --edit-todo'
|
if a:cmd =~# '^rebase' && ' '.a:args =~# ' -i\| --interactive\| --edit-todo'
|
||||||
return 'echoerr "git rebase --interactive not supported"'
|
return 'echoerr "git rebase --interactive not supported"'
|
||||||
endif
|
endif
|
||||||
@ -2385,7 +2386,7 @@ function! s:Merge(cmd, bang, args) abort
|
|||||||
if empty(filter(getqflist(),'v:val.valid'))
|
if empty(filter(getqflist(),'v:val.valid'))
|
||||||
if !had_merge_msg && filereadable(b:git_dir . '/MERGE_MSG')
|
if !had_merge_msg && filereadable(b:git_dir . '/MERGE_MSG')
|
||||||
cclose
|
cclose
|
||||||
return 'Gcommit --no-status -n -t '.s:shellesc(b:git_dir . '/MERGE_MSG')
|
return mods . 'Gcommit --no-status -n -t '.s:shellesc(b:git_dir . '/MERGE_MSG')
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
let qflist = getqflist()
|
let qflist = getqflist()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user