Skip to content

Commit

Permalink
fix: gitsigns not attached due to async not returning
Browse files Browse the repository at this point in the history
  • Loading branch information
yamgent authored and lewis6991 committed Nov 23, 2023
1 parent 0ccd5fb commit 59bd933
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions lua/gitsigns.lua
Original file line number Diff line number Diff line change
Expand Up @@ -119,20 +119,20 @@ end
local function setup_attach()
scheduler()

api.nvim_create_autocmd({ 'BufRead', 'BufNewFile', 'BufWritePost' }, {
group = 'gitsigns',
callback = function(data)
M.attach(nil, nil, data.event)
end,
})

-- Attach to all open buffers
for _, buf in ipairs(api.nvim_list_bufs()) do
if api.nvim_buf_is_loaded(buf) and api.nvim_buf_get_name(buf) ~= '' then
M.attach(buf, nil, 'setup')
scheduler()
end
end

api.nvim_create_autocmd({ 'BufRead', 'BufNewFile', 'BufWritePost' }, {
group = 'gitsigns',
callback = function(data)
M.attach(nil, nil, data.event)
end,
})
end

local function setup_cwd_head()
Expand Down

0 comments on commit 59bd933

Please sign in to comment.