From f39a0f1f3c2594c522392a4fd35812f33bcd64a8 Mon Sep 17 00:00:00 2001 From: ShyRobin Date: Fri, 6 Dec 2024 23:41:02 +0800 Subject: [PATCH] fix: Can't re-enter normal mode from terminal mode --- lua/nvim-tree.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lua/nvim-tree.lua b/lua/nvim-tree.lua index 212d4c14bab..bec3e28bc4d 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)