Gutter is not always updated using git-gutter:update-all-windows
brownts opened this issue · 0 comments
I typically have git-gutter:update-all-windows
registered in my magit-post-refresh
hook. However, I recently discovered when I performed a commit, the gutter did not clear when the commit happened, even though the git-gutter:update-all-windows
hook was registered. Actually, this should have updated when I staged the change, but I didn't notice it until after the commit.
After some investigation into git-gutter:update-all-windows
I discovered that this function only refreshes buffers in the current frame. In my previous scenario I was working with two frames, one which contained the Magit status buffer in a window and the other frame containing the file that was committed. Since the committed file buffer was not visible in the same frame as the Magit status buffer (it was only visible in the other frame), when git-gutter:update-all-windows
was called from the Magit status buffer frame, it did not refresh the gutter of the committed file's buffer.
The reason git-gutter:update-all-windows
only works on the current frame is that it uses the window-list
function, which by default will use the current frame (and thus only contains a list of windows for the current frame) when the frame parameter is omitted.