mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-08 11:33:47 -05:00
Prevent bells during :Gwrite
This commit is contained in:
@@ -580,7 +580,10 @@ function! s:Write(force,...) abort
|
|||||||
for winnr in range(1,tabpagewinnr(tab,'$'))
|
for winnr in range(1,tabpagewinnr(tab,'$'))
|
||||||
if tabpagebuflist(tab)[winnr-1] == treebufnr
|
if tabpagebuflist(tab)[winnr-1] == treebufnr
|
||||||
execute 'tabnext '.tab
|
execute 'tabnext '.tab
|
||||||
execute winnr.'wincmd w'
|
if winnr != winnr()
|
||||||
|
execute winnr.'wincmd w'
|
||||||
|
let restorewinnr = 1
|
||||||
|
endif
|
||||||
try
|
try
|
||||||
let lnum = line('.')
|
let lnum = line('.')
|
||||||
let last = line('$')
|
let last = line('$')
|
||||||
@@ -590,7 +593,9 @@ function! s:Write(force,...) abort
|
|||||||
silent execute lnum
|
silent execute lnum
|
||||||
let did = 1
|
let did = 1
|
||||||
finally
|
finally
|
||||||
wincmd p
|
if exists('restorewinnr')
|
||||||
|
wincmd p
|
||||||
|
endif
|
||||||
execute 'tabnext '.mytab
|
execute 'tabnext '.mytab
|
||||||
endtry
|
endtry
|
||||||
endif
|
endif
|
||||||
@@ -621,6 +626,7 @@ function! s:Write(force,...) abort
|
|||||||
endif
|
endif
|
||||||
endfor
|
endfor
|
||||||
|
|
||||||
|
unlet! restorewinnr
|
||||||
let zero = s:repo().translate(':0:'.path)
|
let zero = s:repo().translate(':0:'.path)
|
||||||
for tab in range(1,tabpagenr('$'))
|
for tab in range(1,tabpagenr('$'))
|
||||||
for winnr in range(1,tabpagewinnr(tab,'$'))
|
for winnr in range(1,tabpagewinnr(tab,'$'))
|
||||||
@@ -628,7 +634,10 @@ function! s:Write(force,...) abort
|
|||||||
let bufname = bufname(bufnr)
|
let bufname = bufname(bufnr)
|
||||||
if bufname ==# zero && bufnr != mybufnr
|
if bufname ==# zero && bufnr != mybufnr
|
||||||
execute 'tabnext '.tab
|
execute 'tabnext '.tab
|
||||||
execute winnr.'wincmd w'
|
if winnr != winnr()
|
||||||
|
execute winnr.'wincmd w'
|
||||||
|
let restorewinnr = 1
|
||||||
|
endif
|
||||||
try
|
try
|
||||||
let lnum = line('.')
|
let lnum = line('.')
|
||||||
let last = line('$')
|
let last = line('$')
|
||||||
@@ -638,7 +647,9 @@ function! s:Write(force,...) abort
|
|||||||
set nomodified
|
set nomodified
|
||||||
diffupdate
|
diffupdate
|
||||||
finally
|
finally
|
||||||
wincmd p
|
if exists('restorewinnr')
|
||||||
|
wincmd p
|
||||||
|
endif
|
||||||
execute 'tabnext '.mytab
|
execute 'tabnext '.mytab
|
||||||
endtry
|
endtry
|
||||||
break
|
break
|
||||||
|
|||||||
Reference in New Issue
Block a user