diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim index 3ee18d3..cefd59b 100644 --- a/autoload/fugitive.vim +++ b/autoload/fugitive.vim @@ -2302,14 +2302,21 @@ function! s:Merge(cmd, bang, mods, args) abort let &l:makeprg = g:fugitive_git_executable.' diff-files --name-status --diff-filter=U' else let &l:makeprg = s:sub(s:UserCommand() . ' ' . a:cmd . - \ (a:args =~# ' \%(--no-edit\|--abort\|-m\)\>' || a:cmd =~# '^rebase' ? '' : ' --edit') . + \ (' ' . a:args =~# ' \%(--no-edit\|--abort\|-m\)\>' || a:cmd =~# '^rebase' ? '' : ' --edit') . + \ (' ' . a:args =~# ' --autosquash\>' && a:cmd =~# '^rebase' ? ' --interactive' : '') . \ ' ' . a:args, ' *$', '') endif + if !empty($GIT_SEQUENCE_EDITOR) || has('win32') + let old_sequence_editor = $GIT_SEQUENCE_EDITOR + let $GIT_SEQUENCE_EDITOR = 'true' + else + let &l:makeprg = 'env GIT_SEQUENCE_EDITOR=true ' . &l:makeprg + endif if !empty($GIT_EDITOR) || has('win32') let old_editor = $GIT_EDITOR let $GIT_EDITOR = 'false' else - let &l:makeprg = 'env GIT_EDITOR=false ' . &l:makeprg + let &l:makeprg = 'env GIT_EDITOR=false ' . substitute(&l:makeprg, '^env ', '', '') endif silent noautocmd make! catch /^Vim\%((\a\+)\)\=:E211/ @@ -2320,6 +2327,9 @@ function! s:Merge(cmd, bang, mods, args) abort if exists('old_editor') let $GIT_EDITOR = old_editor endif + if exists('old_sequence_editor') + let $GIT_SEQUENCE_EDITOR = old_editor + endif execute cdback endtry call fugitive#ReloadStatus()