From de13b6a64e4e43172a6678d05b18c3e6b5abf5e5 Mon Sep 17 00:00:00 2001 From: Maurice Wangleng Tan Date: Fri, 17 Nov 2023 23:41:52 +0800 Subject: [PATCH] fix: gitsigns not attached due to async not returning --- lua/gitsigns.lua | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lua/gitsigns.lua b/lua/gitsigns.lua index 5759465c8..94565fe14 100644 --- a/lua/gitsigns.lua +++ b/lua/gitsigns.lua @@ -119,6 +119,13 @@ 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 @@ -126,13 +133,6 @@ local function setup_attach() 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()