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
|
endfunction
|
||||||
|
|
||||||
function! s:Expand(rev) abort
|
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))
|
call s:throw('Use ' . string(a:rev . ':%') . ' instead of ' . string(a:rev))
|
||||||
elseif a:rev =~# '^@{' || a:rev =~# '^\^[0-9~^{]\|^\~[0-9~^]\|^\^$'
|
elseif a:rev =~# '^@{' || a:rev =~# '^\^[0-9~^{]\|^\~[0-9~^]\|^\^$'
|
||||||
call s:throw('Use ' . string('!' . a:rev . ':%') . ' instead of ' . string(a:rev))
|
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
|
else
|
||||||
let &l:makeprg = 'env GIT_EDITOR=false ' . substitute(&l:makeprg, '^env ', '', '')
|
let &l:makeprg = 'env GIT_EDITOR=false ' . substitute(&l:makeprg, '^env ', '', '')
|
||||||
endif
|
endif
|
||||||
silent noautocmd make!
|
try
|
||||||
catch /^Vim\%((\a\+)\)\=:E211/
|
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
|
let err = v:exception
|
||||||
finally
|
finally
|
||||||
redraw!
|
redraw!
|
||||||
@@ -3453,7 +3466,18 @@ function! s:Dispatch(bang, args)
|
|||||||
if exists(':Make') == 2
|
if exists(':Make') == 2
|
||||||
Make
|
Make
|
||||||
else
|
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!
|
redraw!
|
||||||
return 'call fugitive#Cwindow()|call fugitive#ReloadStatus()'
|
return 'call fugitive#Cwindow()|call fugitive#ReloadStatus()'
|
||||||
endif
|
endif
|
||||||
|
|||||||
Reference in New Issue
Block a user