fix: 'cd ..' going above the main dir of project
This commit is contained in:
@@ -13,7 +13,6 @@ local M = {
|
|||||||
BUF_NAME = 'LuaTree'
|
BUF_NAME = 'LuaTree'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function M.get_buf()
|
function M.get_buf()
|
||||||
local regex = '.*'..M.BUF_NAME..'$';
|
local regex = '.*'..M.BUF_NAME..'$';
|
||||||
|
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ function M.open_file(open_type)
|
|||||||
local node = tree[tree_index]
|
local node = tree[tree_index]
|
||||||
|
|
||||||
if node.name == '..' then
|
if node.name == '..' then
|
||||||
api.nvim_command('cd ..')
|
api.nvim_command('cd '..node.path..'/..')
|
||||||
|
|
||||||
local new_path = get_cwd()
|
local new_path = get_cwd()
|
||||||
if new_path ~= '/' then
|
if new_path ~= '/' then
|
||||||
|
|||||||
Reference in New Issue
Block a user