commit b6545ad389c32b795d2ad4ae4c45f87e92eb0caf (tree)
parent be0abe0b2171f8be1b100f45856b9eb106773641
Author: Tim Pope <code@tpope.net>
Date: Fri, 10 Sep 2021 02:39:54 -0400
Fix inconsistency when scrolling :Git! preview window
Scrolling with win_execute() works fine while the command is running,
but once the job has finished, it fails to update the viewport until the
window is focused. I don't get it. It's not like the window knows a
job is running. The only obvious trigger I could find is that
'nobuflisted' is set once once the job completes, but even disabling
that behavior fails to rectify the problem. Screw it, manual focus
bouncing for everyone.
References: https://github.com/tpope/vim-fugitive/issues/1832
Diffstat:
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim
@@ -3214,11 +3214,7 @@ function! s:RunReceive(state, tmp, type, job, data, ...) abort
call setbufline(a:state.capture_bufnr, line_count + 1, lines)
endif
call setbufvar(a:state.capture_bufnr, '&modifiable', 0)
- if !getwinvar(bufwinid(a:state.capture_bufnr), '&previewwindow')
- " no-op
- elseif exists('*win_execute')
- call win_execute(bufwinid(a:state.capture_bufnr), '$')
- else
+ if getwinvar(bufwinid(a:state.capture_bufnr), '&previewwindow')
let winnr = bufwinnr(a:state.capture_bufnr)
if winnr > 0
let old_winnr = winnr()