chore: add type annotations to (almost) all functions

This commit is contained in:
Akmadan23
2023-11-24 12:01:24 +01:00
parent 46e1f776f0
commit fabea3376e
48 changed files with 438 additions and 83 deletions

View File

@@ -3,13 +3,14 @@ local core = require "nvim-tree.core"
local M = {}
---@param node Node
function M.fn(node)
if not node or node.name == ".." then
return require("nvim-tree.actions.root.change-dir").fn ".."
require("nvim-tree.actions.root.change-dir").fn ".."
else
local newdir = vim.fn.fnamemodify(utils.path_remove_trailing(core.get_cwd()), ":h")
require("nvim-tree.actions.root.change-dir").fn(newdir)
return require("nvim-tree.actions.finders.find-file").fn(node.absolute_path)
require("nvim-tree.actions.finders.find-file").fn(node.absolute_path)
end
end