From 5fcbc21edb08c77b3afd938958ad70178ee74d1f Mon Sep 17 00:00:00 2001 From: kiyan42 Date: Mon, 18 May 2020 20:01:19 +0200 Subject: [PATCH] fix opening a file should change the tree base --- lua/tree.lua | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lua/tree.lua b/lua/tree.lua index 42a6dde7..9d278c9e 100644 --- a/lua/tree.lua +++ b/lua/tree.lua @@ -168,6 +168,13 @@ function M.check_buffer_and_open() init_tree() M.toggle() + else + local new_path = get_cwd() + if new_path ~= '/' then + new_path = new_path .. '/' + end + set_root_path(new_path) + init_tree() end end