From 6e34bf30397a096a7d0e0b0931edfbe2ca9854ae Mon Sep 17 00:00:00 2001 From: "RingOfStorms (Joshua Bell)" Date: Thu, 21 Sep 2023 11:09:10 -0500 Subject: [PATCH] fix telescope bug stopping insert randomly --- lua/autocommands.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lua/autocommands.lua b/lua/autocommands.lua index 7748c50..a3bb409 100644 --- a/lua/autocommands.lua +++ b/lua/autocommands.lua @@ -33,11 +33,12 @@ vim.api.nvim_create_autocmd("BufRead", { end, }) +-- AUto exit insert mode whenever we switch screens vim.api.nvim_create_autocmd({ "BufEnter", "BufWinEnter" }, { callback = function() - -- if vim.bo.filetype == 'neo-tree' then - vim.api.nvim_command("stopinsert") - -- end + if vim.bo.filetype ~= "TelescopePrompt" and vim.bo.filetype ~= nil and vim.bo.filetype ~= "" then + vim.api.nvim_command("stopinsert") + end end, })