From db8d7ac1f524fc6f808764b29fa695c51e014aa6 Mon Sep 17 00:00:00 2001 From: ShyRobin <59857729+shy-robin@users.noreply.github.com> Date: Sun, 8 Dec 2024 09:05:33 +0800 Subject: [PATCH] fix(#3018): error when focusing nvim-tree when in terminal mode (#3019) fix: Can't re-enter normal mode from terminal mode Co-authored-by: Alexander Courtis --- lua/nvim-tree.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lua/nvim-tree.lua b/lua/nvim-tree.lua index 6ee2fd26..09b5bacd 100644 --- a/lua/nvim-tree.lua +++ b/lua/nvim-tree.lua @@ -199,6 +199,10 @@ local function setup_autocommands(opts) callback = function() vim.schedule(function() vim.api.nvim_buf_call(0, function() + local is_term_mode = vim.api.nvim_get_mode().mode == "t" + if is_term_mode then + return + end vim.cmd([[norm! zz]]) end) end)