Reputation: 25
I want to develop a vim plugin that writes some lines to inactive window(some window for async command output etc.)
I know I can use "setbufline" to write to buffer, and use redraw to draw the vim screen. but I can't find a function to scroll specific window to bottom. Is there a function like "cbottom" but works for normal window?
Upvotes: 2
Views: 176
Reputation: 1813
Assuming you know the windowId of the window to scroll and you stored it in the variable g:scrollWinId
:
let curWinId = win_getid()
call win_gotoid(g:scrollWinId)
normal! G
call win_gotoid(curWinId)
I'm not aware that there is a simple function in Vim script or a autocmd that could be used.
BTW: You might want to use appendbufline
instead of setbufline
.
Upvotes: 3