From 015e7e86114d8c5bee3b96316a453d1275238419 Mon Sep 17 00:00:00 2001 From: kiyan Date: Wed, 16 Feb 2022 20:51:52 +0100 Subject: [PATCH] fix: focus view if view is open on nvim-tree.open --- lua/nvim-tree.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lua/nvim-tree.lua b/lua/nvim-tree.lua index 35f10c33..f1b8f74f 100644 --- a/lua/nvim-tree.lua +++ b/lua/nvim-tree.lua @@ -37,7 +37,9 @@ end function M.open(cwd) cwd = cwd ~= "" and cwd or nil - if not view.is_visible() then + if view.is_visible() then + view.focus() + else lib.open(cwd) end end