Remove 'guioptions' workaround

This commit is contained in:
Tim Pope
2019-08-09 00:44:04 -04:00
parent 8227503714
commit bc3d36e559

View File

@@ -3246,41 +3246,33 @@ function! s:CommitSubcommand(line1, line2, range, bang, mods, args, ...) abort
let msgfile = fugitive#Find('.git/COMMIT_EDITMSG', dir) let msgfile = fugitive#Find('.git/COMMIT_EDITMSG', dir)
let outfile = tempname() let outfile = tempname()
try try
let guioptions = &guioptions if s:winshell()
try let command = 'set GIT_EDITOR=false& '
if &guioptions =~# '!' else
setglobal guioptions-=! let command = 'env GIT_EDITOR=false '
endif endif
if s:winshell() let argv = a:args
let command = 'set GIT_EDITOR=false& ' let i = 0
while get(argv, i, '--') !=# '--'
if argv[i] =~# '^-[apzsneiovq].'
call insert(argv, argv[i][0:1])
let argv[i+1] = '-' . argv[i+1][2:-1]
else else
let command = 'env GIT_EDITOR=false ' let i += 1
endif endif
let argv = a:args endwhile
let i = 0 let command .= s:UserCommand(dir) . ' commit ' . s:shellesc(argv)
while get(argv, i, '--') !=# '--' if (&autowrite || &autowriteall) && !a:0
if argv[i] =~# '^-[apzsneiovq].' silent! wall
call insert(argv, argv[i][0:1]) endif
let argv[i+1] = '-' . argv[i+1][2:-1] if s:HasOpt(argv, '-i', '--interactive')
else return s:CommitInteractive(a:line1, a:line2, a:range, a:bang, a:mods, argv, 0)
let i += 1 elseif s:HasOpt(argv, '-p', '--patch')
endif return s:CommitInteractive(a:line1, a:line2, a:range, a:bang, a:mods, argv, 1)
endwhile else
let command .= s:UserCommand(dir) . ' commit ' . s:shellesc(argv) let [error_string, exec_error] = s:TempCmd(outfile, command)
if (&autowrite || &autowriteall) && !a:0 let errors = split(error_string, "\n")
silent! wall endif
endif
if s:HasOpt(argv, '-i', '--interactive')
return s:CommitInteractive(a:line1, a:line2, a:range, a:bang, a:mods, argv, 0)
elseif s:HasOpt(argv, '-p', '--patch')
return s:CommitInteractive(a:line1, a:line2, a:range, a:bang, a:mods, argv, 1)
else
let [error_string, exec_error] = s:TempCmd(outfile, command)
let errors = split(error_string, "\n")
endif
finally
let &guioptions = guioptions
endtry
if !has('gui_running') if !has('gui_running')
redraw! redraw!
endif endif