From 2b6734c7313212fa4416c51f2336af7600236715 Mon Sep 17 00:00:00 2001 From: Jason Gerber Date: Tue, 10 Sep 2024 14:26:08 +0200 Subject: [PATCH] fix(suggestion): Trigger suggestion on InsertEnter --- lua/copilot/suggestion.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/copilot/suggestion.lua b/lua/copilot/suggestion.lua index 3c7d9e2d..36378998 100644 --- a/lua/copilot/suggestion.lua +++ b/lua/copilot/suggestion.lua @@ -324,7 +324,7 @@ local function trigger(bufnr, timer) local _timer = copilot._copilot_timer copilot._copilot_timer = nil - if bufnr ~= vim.api.nvim_get_current_buf() or timer ~= _timer or vim.fn.mode() ~= "i" then + if bufnr ~= vim.api.nvim_get_current_buf() or (_timer ~= nil and timer ~= _timer) or vim.fn.mode() ~= "i" then return end