Skip to content

Commit 52d1d7e

Browse files
committed
fix: 'cd ..' going above the main dir of project
1 parent 97785a3 commit 52d1d7e

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

lua/lib/winutils.lua

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ local M = {
1313
BUF_NAME = 'LuaTree'
1414
}
1515

16-
1716
function M.get_buf()
1817
local regex = '.*'..M.BUF_NAME..'$';
1918

lua/tree.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ function M.open_file(open_type)
7373
local node = tree[tree_index]
7474

7575
if node.name == '..' then
76-
api.nvim_command('cd ..')
76+
api.nvim_command('cd '..node.path..'/..')
7777

7878
local new_path = get_cwd()
7979
if new_path ~= '/' then

0 commit comments

Comments
 (0)