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 <alex@courtis.org>
This commit is contained in:
ShyRobin 2024-12-08 09:05:33 +08:00 committed by GitHub
parent 6b4be1dc0c
commit db8d7ac1f5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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)