* stylua -> EmmyLuaCodeStyle: config and doc * stylua -> EmmyLuaCodeStyle: CI * stylua -> EmmyLuaCodeStyle: CI * stylua -> EmmyLuaCodeStyle: CI * stylua -> EmmyLuaCodeStyle: CI * stylua -> EmmyLuaCodeStyle: CI * stylua -> EmmyLuaCodeStyle * stylua -> EmmyLuaCodeStyle: call_arg_parentheses = always * stylua -> EmmyLuaCodeStyle * stylua -> EmmyLuaCodeStyle
23 lines
547 B
Lua
23 lines
547 B
Lua
local utils = require("nvim-tree.utils")
|
|
local core = require("nvim-tree.core")
|
|
|
|
local M = {}
|
|
|
|
---@param node Node
|
|
function M.fn(node)
|
|
if not node or node.name == ".." then
|
|
require("nvim-tree.actions.root.change-dir").fn("..")
|
|
else
|
|
local cwd = core.get_cwd()
|
|
if cwd == nil then
|
|
return
|
|
end
|
|
|
|
local newdir = vim.fn.fnamemodify(utils.path_remove_trailing(cwd), ":h")
|
|
require("nvim-tree.actions.root.change-dir").fn(newdir)
|
|
require("nvim-tree.actions.finders.find-file").fn(node.absolute_path)
|
|
end
|
|
end
|
|
|
|
return M
|