Skip to content

Commit

Permalink
fix: check for WinResized
Browse files Browse the repository at this point in the history
  • Loading branch information
lewis6991 committed Apr 5, 2024
1 parent 5f267aa commit c093623
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions lua/gitsigns/current_line_blame.lua
Original file line number Diff line number Diff line change
Expand Up @@ -201,16 +201,19 @@ function M.setup()
end

if config.current_line_blame then
api.nvim_create_autocmd(
{ 'WinResized', 'FocusGained', 'BufEnter', 'CursorMoved', 'CursorMovedI' },
{
group = group,
callback = function(args)
reset(args.buf)
update_debounced(args.buf)
end,
}
)
local events = { 'FocusGained', 'BufEnter', 'CursorMoved', 'CursorMovedI' }
if vim.fn.exists('#WinResized') == 1 then
-- For nvim 0.9+
events[#events + 1] = 'WinResized'
end

api.nvim_create_autocmd(events, {
group = group,
callback = function(args)
reset(args.buf)
update_debounced(args.buf)
end,
})

api.nvim_create_autocmd({ 'InsertEnter', 'FocusLost', 'BufLeave' }, {
group = group,
Expand Down

0 comments on commit c093623

Please sign in to comment.