Scroll the output buffer when visible
This commit is contained in:
parent
c898eb47b2
commit
149d48b688
1 changed files with 11 additions and 1 deletions
|
|
@ -119,7 +119,6 @@ function! s:_OnCommandEvent( category, id, data, event ) abort
|
||||||
let last_line = last_line_list[ 0 ]
|
let last_line = last_line_list[ 0 ]
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
call s:MakeBufferWritable( buffer )
|
call s:MakeBufferWritable( buffer )
|
||||||
try
|
try
|
||||||
call setbufline( buffer, '$', last_line . a:data[ 0 ] )
|
call setbufline( buffer, '$', last_line . a:data[ 0 ] )
|
||||||
|
|
@ -129,6 +128,17 @@ function! s:_OnCommandEvent( category, id, data, event ) abort
|
||||||
call setbufvar( buffer, '&modified', 0 )
|
call setbufvar( buffer, '&modified', 0 )
|
||||||
endtry
|
endtry
|
||||||
|
|
||||||
|
" if the buffer is visible, scroll it
|
||||||
|
let w = bufwinnr( buffer )
|
||||||
|
if w > 0
|
||||||
|
let cw = winnr()
|
||||||
|
try
|
||||||
|
execute w . 'wincmd w'
|
||||||
|
normal G
|
||||||
|
finally
|
||||||
|
execute cw . 'wincmd w'
|
||||||
|
endtry
|
||||||
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:SetUpHiddenBuffer( buffer ) abort
|
function! s:SetUpHiddenBuffer( buffer ) abort
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue