Closed resolritter closed 4 years ago
Well, so what this issue for? Bug report or feature request or else?
The issue suggests that this behavior "Refresh gina-status
buffer whenever you enter it" is not happening currently, but is desirable. It'd be a feature request if this is not intended by design or a bug report if you believe this is supposed to be happening already.
The behavior I notice currently is:
gina-commit
buffergina-status
buffer => it is updated when I create itHowever, if I switch back to a existing status buffer, it seems like it doesn't update on BufEnter
. It should, because changes could have been made on a terminal (ex: Gina!! add -i
) or outside of vim.
The workaround for this problem is to manually call :edit
, which will trigger the autocommand to refresh the buffer, but I find this is annoying to keep doing manually for every single commit.
When I opened this issue, I did not know what to do. Just recently I took a deeper look at the autocommands and made a script which works decently well.
fun! RefreshStatus()
if win_findbuf(bufnr('#')) == []
set modifiable
call deletebufline(bufnr('%'), 1, line('$'))
set nomodifiable
call gina#util#doautocmd('BufReadCmd')
endif
endfun
autocmd BufEnter,FocusGained <buffer> call RefreshStatus()
I think this solution is fine. Thanks for your time.
Hello!
I don't have exact reproduction steps, but sometimes, when I re-enter the
gina-status
buffer, it's not updated after a commit. That may also happen if you commit something outside of Vim and come back to it later.In those situations, I'm often forced to call
:edit
which refreshes the buffer through autocommands. It would be very nice if the buffer automatically refreshed whenever you switched to it. I am thinking of something along those lines:as
win_findbuf
only checks if a buffer is open in the current tab, this "automatic refresh" wouldn't happen ifgina-status
is already open in a split (this concern is necessary to avoid refreshing the buffer while the cursor is already doing something in it).