mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-10 20:43:46 -05:00
Work around autowrite bug when :terminal is open
This commit is contained in:
@@ -857,7 +857,9 @@ function! s:ExpandVar(other, var, flags, esc) abort
|
||||
endfunction
|
||||
|
||||
function! s:Expand(rev) abort
|
||||
if a:rev =~# '^:[0-3]$'
|
||||
if a:rev =~# '^:0'
|
||||
call s:throw('Use ' . string(':%') . ' instead of ' . string(a:rev))
|
||||
elseif a:rev =~# '^:[1-3]$'
|
||||
call s:throw('Use ' . string(a:rev . ':%') . ' instead of ' . string(a:rev))
|
||||
elseif a:rev =~# '^@{' || a:rev =~# '^\^[0-9~^{]\|^\~[0-9~^]\|^\^$'
|
||||
call s:throw('Use ' . string('!' . a:rev . ':%') . ' instead of ' . string(a:rev))
|
||||
@@ -2943,8 +2945,19 @@ function! s:Merge(cmd, bang, mods, args, ...) abort
|
||||
else
|
||||
let &l:makeprg = 'env GIT_EDITOR=false ' . substitute(&l:makeprg, '^env ', '', '')
|
||||
endif
|
||||
silent noautocmd make!
|
||||
catch /^Vim\%((\a\+)\)\=:E211/
|
||||
try
|
||||
if !has('patch-8.1.0334') && &autowrite
|
||||
let autowrite_was_set = 1
|
||||
set noautowrite
|
||||
wall
|
||||
endif
|
||||
silent noautocmd make!
|
||||
finally
|
||||
if exists('autowrite_was_set')
|
||||
set autowrite
|
||||
endif
|
||||
endtry
|
||||
catch /^Vim\%((\a\+)\)\=:E211/
|
||||
let err = v:exception
|
||||
finally
|
||||
redraw!
|
||||
@@ -3453,7 +3466,18 @@ function! s:Dispatch(bang, args)
|
||||
if exists(':Make') == 2
|
||||
Make
|
||||
else
|
||||
silent noautocmd make!
|
||||
try
|
||||
if !has('patch-8.1.0334') && &autowrite
|
||||
let autowrite_was_set = 1
|
||||
set noautowrite
|
||||
wall
|
||||
endif
|
||||
silent noautocmd make!
|
||||
finally
|
||||
if exists('autowrite_was_set')
|
||||
set autowrite
|
||||
endif
|
||||
endtry
|
||||
redraw!
|
||||
return 'call fugitive#Cwindow()|call fugitive#ReloadStatus()'
|
||||
endif
|
||||
|
||||
Reference in New Issue
Block a user