Expose function to reload status window

autocmd FocusGained * call fugitive#reload_status()
This commit is contained in:
Tim Pope 2009-11-03 22:23:58 -05:00
parent aa72be3a09
commit cf41683ac1

View File

@ -424,7 +424,7 @@ function! s:Git(bang,cmd) abort
let git .= ' --no-pager' let git .= ' --no-pager'
endif endif
call s:ExecuteInTree('!'.git.' '.a:cmd) call s:ExecuteInTree('!'.git.' '.a:cmd)
call s:ReloadIndex() call fugitive#reload_status()
endfunction endfunction
function! s:GitComplete(A,L,P) abort function! s:GitComplete(A,L,P) abort
@ -468,7 +468,7 @@ function! s:Status()
return '' return ''
endfunction endfunction
function! s:ReloadIndex() function! fugitive#reload_status()
let mytab = tabpagenr() let mytab = tabpagenr()
for tab in [mytab] + range(1,tabpagenr('$')) for tab in [mytab] + range(1,tabpagenr('$'))
for winnr in range(1,tabpagewinnr(tab,'$')) for winnr in range(1,tabpagewinnr(tab,'$'))
@ -743,7 +743,7 @@ function! s:Write(force,...) abort
endif endif
endfor endfor
endfor endfor
call s:ReloadIndex() call fugitive#reload_status()
return 'checktime' return 'checktime'
endfunction endfunction
@ -823,7 +823,7 @@ function! s:Move(force,destination)
if isdirectory(destination) if isdirectory(destination)
let destination = fnamemodify(s:sub(destination,'/$','').'/'.expand('%:t'),':.') let destination = fnamemodify(s:sub(destination,'/$','').'/'.expand('%:t'),':.')
endif endif
call s:ReloadIndex() call fugitive#reload_status()
if s:buffer().commit() == '' if s:buffer().commit() == ''
return 'saveas! '.s:fnameescape(destination) return 'saveas! '.s:fnameescape(destination)
else else
@ -856,7 +856,7 @@ function! s:Remove(force)
let v:errmsg = 'fugitive: '.s:sub(message,'error:.*\zs\n\(.*-f.*',' (add ! to force)') let v:errmsg = 'fugitive: '.s:sub(message,'error:.*\zs\n\(.*-f.*',' (add ! to force)')
return 'echoerr '.string(v:errmsg) return 'echoerr '.string(v:errmsg)
else else
call s:ReloadIndex() call fugitive#reload_status()
return 'bdelete'.(a:force ? '!' : '') return 'bdelete'.(a:force ? '!' : '')
endif endif
endfunction endfunction
@ -1105,7 +1105,7 @@ function! s:BufWriteIndexFile()
if v:shell_error == 0 if v:shell_error == 0
setlocal nomodified setlocal nomodified
silent execute 'doautocmd BufWritePost '.s:fnameescape(expand('%:p')) silent execute 'doautocmd BufWritePost '.s:fnameescape(expand('%:p'))
call s:ReloadIndex() call fugitive#reload_status()
return '' return ''
else else
return 'echoerr '.string('fugitive: '.error) return 'echoerr '.string('fugitive: '.error)