diff --git a/lua/nvim-tree.lua b/lua/nvim-tree.lua index d4192539d30..cdc5a50389a 100644 --- a/lua/nvim-tree.lua +++ b/lua/nvim-tree.lua @@ -141,17 +141,6 @@ local function manage_netrw() end end ----@param name string|nil -function M.change_dir(name) - if name then - explorer_fn("change_dir", name) - end - - if config.g.update_focused_file.update_root.enable then - actions.tree.find_file.fn() - end -end - local function setup_autocommands() local augroup_id = vim.api.nvim_create_augroup("NvimTree", { clear = true }) local function create_nvim_tree_autocmd(name, custom_opts) @@ -180,7 +169,7 @@ local function setup_autocommands() if config.g.sync_root_with_cwd then create_nvim_tree_autocmd("DirChanged", { callback = function() - M.change_dir(vim.loop.cwd()) + actions.tree.change_dir.fn(vim.loop.cwd()) end, }) end diff --git a/lua/nvim-tree/actions/fs/rename-file.lua b/lua/nvim-tree/actions/fs/rename-file.lua index b4f9c945010..ee1c4857984 100644 --- a/lua/nvim-tree/actions/fs/rename-file.lua +++ b/lua/nvim-tree/actions/fs/rename-file.lua @@ -97,81 +97,98 @@ function M.rename(node, to) end end ----@param default_modifier string|nil ----@return fun(node: Node, modifier: string) -function M.fn(default_modifier) - default_modifier = default_modifier or ":t" - - return function(node, modifier) - local explorer = core.get_explorer() - if not explorer then - return - end +---@param node Node +---@param modifier? string +local function prompt_to_rename(node, modifier) + if not modifier or type(modifier) ~= "string" then + modifier = ":t" + end - if type(node) ~= "table" then - node = explorer:get_node_at_cursor() - end - if not node then + local explorer = core.get_explorer() + if not explorer then + return + end + + if type(node) ~= "table" then + local node_at_cursor = explorer:get_node_at_cursor() + if not node_at_cursor then return end + node = node_at_cursor + end - if type(modifier) ~= "string" then - modifier = default_modifier - end + -- support for only specific modifiers have been implemented + if not ALLOWED_MODIFIERS[modifier] then + notify.warn("Modifier " .. vim.inspect(modifier) .. " is not in allowed list : " .. table.concat(ALLOWED_MODIFIERS, ",")) + return + end - -- support for only specific modifiers have been implemented - if not ALLOWED_MODIFIERS[modifier] then - notify.warn("Modifier " .. vim.inspect(modifier) .. " is not in allowed list : " .. table.concat(ALLOWED_MODIFIERS, ",")) - return - end + local dir = node:as(DirectoryNode) + if dir then + node = dir:last_group_node() + end + if node.name == ".." then + return + end - local dir = node:as(DirectoryNode) - if dir then - node = dir:last_group_node() - end - if node.name == ".." then + local namelen = node.name:len() + local directory = node.absolute_path:sub(0, namelen * -1 - 1) + local default_path + local prepend = "" + local append = "" + default_path = vim.fn.fnamemodify(node.absolute_path, modifier) + if modifier:sub(0, 2) == ":t" then + prepend = directory + end + if modifier == ":t:r" then + local extension = vim.fn.fnamemodify(node.name, ":e") + append = extension:len() == 0 and "" or "." .. extension + end + if modifier == ":p:h" then + default_path = default_path .. "/" + end + + local input_opts = { + prompt = "Rename to ", + default = default_path, + completion = "file", + } + + vim.ui.input(input_opts, function(new_file_path) + utils.clear_prompt() + if not new_file_path then return end - local namelen = node.name:len() - local directory = node.absolute_path:sub(0, namelen * -1 - 1) - local default_path - local prepend = "" - local append = "" - default_path = vim.fn.fnamemodify(node.absolute_path, modifier) - if modifier:sub(0, 2) == ":t" then - prepend = directory - end - if modifier == ":t:r" then - local extension = vim.fn.fnamemodify(node.name, ":e") - append = extension:len() == 0 and "" or "." .. extension - end - if modifier == ":p:h" then - default_path = default_path .. "/" + local full_new_path = prepend .. new_file_path .. append + + M.rename(node, full_new_path) + if not M.config.filesystem_watchers.enable then + explorer:reload_explorer() end - local input_opts = { - prompt = "Rename to ", - default = default_path, - completion = "file", - } + find_file(utils.path_remove_trailing(full_new_path)) + end) +end - vim.ui.input(input_opts, function(new_file_path) - utils.clear_prompt() - if not new_file_path then - return - end +---@param node Node +function M.rename_node(node) + prompt_to_rename(node, ":t") +end - local full_new_path = prepend .. new_file_path .. append +---@param node Node +function M.rename_sub(node) + prompt_to_rename(node, ":p:h") +end - M.rename(node, full_new_path) - if not M.config.filesystem_watchers.enable then - explorer:reload_explorer() - end +---@param node Node +function M.rename_basename(node) + prompt_to_rename(node, ":t:r") +end - find_file(utils.path_remove_trailing(full_new_path)) - end) - end +---@param node Node +function M.rename_full(node) + prompt_to_rename(node, ":p") end function M.setup(opts) diff --git a/lua/nvim-tree/actions/moves/item.lua b/lua/nvim-tree/actions/moves/item.lua index 449cb2212c0..0f5a2621b55 100644 --- a/lua/nvim-tree/actions/moves/item.lua +++ b/lua/nvim-tree/actions/moves/item.lua @@ -215,32 +215,77 @@ end ---@field recurse boolean? ---@param opts NavigationItemOpts ----@return fun() -function M.fn(opts) - return function() - local explorer = core.get_explorer() - if not explorer then - return - end +local function item(opts) + local explorer = core.get_explorer() + if not explorer then + return + end - local recurse = false + local recurse = false - -- recurse only valid for git and diag moves. - if (opts.what == "git" or opts.what == "diag") and opts.recurse ~= nil then - recurse = opts.recurse - end + -- recurse only valid for git and diag moves. + if (opts.what == "git" or opts.what == "diag") and opts.recurse ~= nil then + recurse = opts.recurse + end - if not recurse then - move(explorer, opts.where, opts.what, opts.skip_gitignored) - return - end + if not recurse then + move(explorer, opts.where, opts.what, opts.skip_gitignored) + return + end - if opts.where == "next" then - move_next_recursive(explorer, opts.what, opts.skip_gitignored) - elseif opts.where == "prev" then - move_prev_recursive(explorer, opts.what, opts.skip_gitignored) - end + if opts.where == "next" then + move_next_recursive(explorer, opts.what, opts.skip_gitignored) + elseif opts.where == "prev" then + move_prev_recursive(explorer, opts.what, opts.skip_gitignored) end end +function M.git_next() + item({ where = "next", what = "git" }) +end + +function M.git_next_skip_gitignored() + item({ where = "next", what = "git", skip_gitignored = true }) +end + +function M.git_next_recursive() + item({ where = "next", what = "git", recurse = true }) +end + +function M.git_prev() + item({ where = "prev", what = "git" }) +end + +function M.git_prev_skip_gitignored() + item({ where = "prev", what = "git", skip_gitignored = true }) +end + +function M.git_prev_recursive() + item({ where = "prev", what = "git", recurse = true }) +end + +function M.diagnostics_next() + item({ where = "next", what = "diag" }) +end + +function M.diagnostics_next_recursive() + item({ where = "next", what = "diag", recurse = true }) +end + +function M.diagnostics_prev() + item({ where = "prev", what = "diag" }) +end + +function M.diagnostics_prev_recursive() + item({ where = "prev", what = "diag", recurse = true }) +end + +function M.opened_next() + item({ where = "next", what = "opened" }) +end + +function M.opened_prev() + item({ where = "prev", what = "opened" }) +end + return M diff --git a/lua/nvim-tree/actions/moves/parent.lua b/lua/nvim-tree/actions/moves/parent.lua index 555bd6e1105..ad415be406a 100644 --- a/lua/nvim-tree/actions/moves/parent.lua +++ b/lua/nvim-tree/actions/moves/parent.lua @@ -3,40 +3,45 @@ local DirectoryNode = require("nvim-tree.node.directory") local M = {} ----@param should_close boolean|nil ----@return fun(node: Node): boolean|nil -function M.fn(should_close) - should_close = should_close or false - - ---@param node Node - return function(node) - local dir = node:as(DirectoryNode) - if dir then - dir = dir:last_group_node() - if should_close and dir.open then - dir.open = false - dir.explorer.renderer:draw() - return - end +---@param node Node +---@param should_close boolean +local function move(node, should_close) + local dir = node:as(DirectoryNode) + if dir then + dir = dir:last_group_node() + if should_close and dir.open then + dir.open = false + dir.explorer.renderer:draw() + return end + end - local parent = (node:get_parent_of_group() or node).parent + local parent = (node:get_parent_of_group() or node).parent - if not parent or not parent.parent then - view.set_cursor({ 1, 0 }) - return - end + if not parent or not parent.parent then + view.set_cursor({ 1, 0 }) + return + end - local _, line = parent.explorer:find_node(function(n) - return n.absolute_path == parent.absolute_path - end) + local _, line = parent.explorer:find_node(function(n) + return n.absolute_path == parent.absolute_path + end) - view.set_cursor({ line + 1, 0 }) - if should_close then - parent.open = false - parent.explorer.renderer:draw() - end + view.set_cursor({ line + 1, 0 }) + if should_close then + parent.open = false + parent.explorer.renderer:draw() end end +---@param node Node +function M.move(node) + move(node, false) +end + +---@param node Node +function M.move_close(node) + move(node, true) +end + return M diff --git a/lua/nvim-tree/actions/moves/sibling.lua b/lua/nvim-tree/actions/moves/sibling.lua index bfb5b5e2fa0..cbe7ab9b07c 100644 --- a/lua/nvim-tree/actions/moves/sibling.lua +++ b/lua/nvim-tree/actions/moves/sibling.lua @@ -3,55 +3,73 @@ local Iterator = require("nvim-tree.iterators.node-iterator") local M = {} ----@param direction string ----@return fun(node: Node): nil -function M.fn(direction) - return function(node) - if node.name == ".." or not direction then - return - end - - local explorer = core.get_explorer() - if not explorer then - return - end - - local first, last, next, prev = nil, nil, nil, nil - local found = false - local parent = node.parent or explorer - Iterator.builder(parent and parent.nodes or {}) - :recursor(function() - return nil - end) - :applier(function(n) - first = first or n - last = n - if n.absolute_path == node.absolute_path then - found = true - return - end - prev = not found and n or prev - if found and not next then - next = n - end - end) - :iterate() - - local target_node - if direction == "first" then - target_node = first - elseif direction == "last" then - target_node = last - elseif direction == "next" then - target_node = next or first - else - target_node = prev or last - end - - if target_node then - explorer:focus_node_or_parent(target_node) - end +---@param node Node +---@param direction "next"|"prev"|"first"|"last" +local function move(node, direction) + if node.name == ".." or not direction then + return end + + local explorer = core.get_explorer() + if not explorer then + return + end + + local first, last, next, prev = nil, nil, nil, nil + local found = false + local parent = node.parent or explorer + Iterator.builder(parent and parent.nodes or {}) + :recursor(function() + return nil + end) + :applier(function(n) + first = first or n + last = n + if n.absolute_path == node.absolute_path then + found = true + return + end + prev = not found and n or prev + if found and not next then + next = n + end + end) + :iterate() + + local target_node + if direction == "first" then + target_node = first + elseif direction == "last" then + target_node = last + elseif direction == "next" then + target_node = next or first + else + target_node = prev or last + end + + if target_node then + explorer:focus_node_or_parent(target_node) + end +end + +---@param node Node +function M.next(node) + move(node, "next") +end + +---@param node Node +function M.prev(node) + move(node, "prev") +end + +---@param node Node +function M.first(node) + move(node, "first") +end + +---@param node Node +function M.last(node) + move(node, "last") end return M diff --git a/lua/nvim-tree/actions/node/open-file.lua b/lua/nvim-tree/actions/node/open-file.lua index 600f8656fbb..984a732e20e 100644 --- a/lua/nvim-tree/actions/node/open-file.lua +++ b/lua/nvim-tree/actions/node/open-file.lua @@ -5,6 +5,16 @@ local utils = require("nvim-tree.utils") local full_name = require("nvim-tree.renderer.components.full-name") local view = require("nvim-tree.view") +local DirectoryNode = require("nvim-tree.node.directory") +local FileLinkNode = require("nvim-tree.node.file-link") +local RootNode = require("nvim-tree.node.root") + +---@class NodeEditOpts +---@field quit_on_open boolean|nil default false +---@field focus boolean|nil default true + +---@alias NodeOpenFileMode ""|"change_dir"|"drop"|"edit"|"edit_in_place"|"edit_no_picker"|"preview"|"preview_no_picker"|"split"|"split_no_picker"|"tab_drop"|"tabnew"|"toggle_group_empty"|"vsplit"|"vsplit_no_picker" + local M = {} ---Get single char from user input @@ -286,6 +296,8 @@ local function set_current_win_no_autocmd(winid, autocmd) vim.opt.eventignore = eventignore end +---@param filename string +---@param mode NodeOpenFileMode local function open_in_new_window(filename, mode) if type(mode) ~= "string" then mode = "" @@ -388,7 +400,7 @@ local function edit_in_current_buf(filename) vim.cmd("keepalt keepjumps edit " .. vim.fn.fnameescape(filename)) end ----@param mode string +---@param mode NodeOpenFileMode ---@param filename string ---@return nil function M.fn(mode, filename) @@ -439,6 +451,119 @@ function M.fn(mode, filename) end end +---@param mode string +---@param node Node +---@param edit_opts NodeEditOpts? +local function edit(mode, node, edit_opts) + local file_link = node:as(FileLinkNode) + local path = file_link and file_link.link_to or node.absolute_path + local cur_tabpage = vim.api.nvim_get_current_tabpage() + + M.fn(mode, path) + + edit_opts = edit_opts or {} + + local mode_unsupported_quit_on_open = mode == "drop" or mode == "tab_drop" or mode == "edit_in_place" + if not mode_unsupported_quit_on_open and edit_opts.quit_on_open then + view.close(cur_tabpage) + end + + local mode_unsupported_focus = mode == "drop" or mode == "tab_drop" or mode == "edit_in_place" + local focus = edit_opts.focus == nil or edit_opts.focus == true + if not mode_unsupported_focus and not focus then + -- if mode == "tabnew" a new tab will be opened and we need to focus back to the previous tab + if mode == "tabnew" then + vim.cmd(":tabprev") + end + view.focus() + end +end + +---@param node Node +---@param mode NodeOpenFileMode +---@param toggle_group boolean? +---@param edit_opts NodeEditOpts? +local function open_or_expand_or_dir_up(node, mode, toggle_group, edit_opts) + local root = node:as(RootNode) + local dir = node:as(DirectoryNode) + + if root or node.name == ".." then + local explorer = require("nvim-tree.core").get_explorer() + if explorer then + explorer:change_dir("..") + end + elseif dir then + dir:expand_or_collapse(toggle_group) + elseif not toggle_group then + edit(mode, node, edit_opts) + end +end + +---@param node Node +function M.toggle_group_empty(node) + open_or_expand_or_dir_up(node, "toggle_group_empty", true) +end + +---@param node Node +function M.preview(node) + open_or_expand_or_dir_up(node, "preview") +end + +---@param node Node +function M.preview_no_picker(node) + open_or_expand_or_dir_up(node, "preview_no_picker") +end + +---@param node Node +function M.edit(node) + open_or_expand_or_dir_up(node, "edit") +end + +---@param node Node +function M.drop(node) + open_or_expand_or_dir_up(node, "drop") +end + +---@param node Node +function M.tab_drop(node) + open_or_expand_or_dir_up(node, "tab_drop") +end + +---@param node Node +function M.replace_tree_buffer(node) + open_or_expand_or_dir_up(node, "edit_in_place") +end + +---@param node Node +function M.no_window_picker(node) + open_or_expand_or_dir_up(node, "edit_no_picker") +end + +---@param node Node +function M.vertical(node) + open_or_expand_or_dir_up(node, "vsplit") +end + +---@param node Node +function M.vertical_no_picker(node) + open_or_expand_or_dir_up(node, "vsplit_no_picker") +end + +---@param node Node +function M.horizontal(node) + open_or_expand_or_dir_up(node, "split") +end + +---@param node Node +function M.horizontal_no_picker(node) + open_or_expand_or_dir_up(node, "split_no_picker") +end + +---@param node Node +function M.tab(node) + open_or_expand_or_dir_up(node, "tabnew") +end + function M.setup(opts) M.quit_on_open = opts.actions.open_file.quit_on_open M.resize_window = opts.actions.open_file.resize_window diff --git a/lua/nvim-tree/actions/tree/change-dir.lua b/lua/nvim-tree/actions/tree/change-dir.lua new file mode 100644 index 00000000000..8bf2af7345c --- /dev/null +++ b/lua/nvim-tree/actions/tree/change-dir.lua @@ -0,0 +1,23 @@ +local core = require("nvim-tree.core") +local find_file = require("nvim-tree.actions.tree.find-file") + +local M = {} + +---@param name? string +function M.fn(name) + local explorer = core.get_explorer() + if name and explorer then + explorer:change_dir(name) + end + + if M.config.update_focused_file.update_root.enable then + find_file.fn() + end +end + +---@param config nvim_tree.config +function M.setup(config) + M.config = config +end + +return M diff --git a/lua/nvim-tree/actions/tree/init.lua b/lua/nvim-tree/actions/tree/init.lua index 6ae2760fb7c..ca0733d7cb3 100644 --- a/lua/nvim-tree/actions/tree/init.lua +++ b/lua/nvim-tree/actions/tree/init.lua @@ -1,5 +1,6 @@ local M = {} +M.change_dir = require("nvim-tree.actions.tree.change-dir") M.find_file = require("nvim-tree.actions.tree.find-file") M.collapse = require("nvim-tree.actions.tree.collapse") M.open = require("nvim-tree.actions.tree.open") @@ -7,6 +8,7 @@ M.toggle = require("nvim-tree.actions.tree.toggle") M.resize = require("nvim-tree.actions.tree.resize") function M.setup(opts) + M.change_dir.setup(opts) M.find_file.setup(opts) M.open.setup(opts) M.toggle.setup(opts) diff --git a/lua/nvim-tree/api/impl/post.lua b/lua/nvim-tree/api/impl/post.lua index b3937467904..aab8009b469 100644 --- a/lua/nvim-tree/api/impl/post.lua +++ b/lua/nvim-tree/api/impl/post.lua @@ -15,10 +15,6 @@ local keymap = require("nvim-tree.keymap") local utils = require("nvim-tree.utils") local view = require("nvim-tree.view") -local DirectoryNode = require("nvim-tree.node.directory") -local FileLinkNode = require("nvim-tree.node.file-link") -local RootNode = require("nvim-tree.node.root") - local M = {} ---Invoke a method on the singleton explorer. @@ -86,58 +82,6 @@ local function wrap_explorer_member(explorer_member, member_method) end end ----@class NodeEditOpts ----@field quit_on_open boolean|nil default false ----@field focus boolean|nil default true - ----@param mode string ----@param node Node ----@param edit_opts NodeEditOpts? -local function edit(mode, node, edit_opts) - local file_link = node:as(FileLinkNode) - local path = file_link and file_link.link_to or node.absolute_path - local cur_tabpage = vim.api.nvim_get_current_tabpage() - - actions.node.open_file.fn(mode, path) - - edit_opts = edit_opts or {} - - local mode_unsupported_quit_on_open = mode == "drop" or mode == "tab_drop" or mode == "edit_in_place" - if not mode_unsupported_quit_on_open and edit_opts.quit_on_open then - view.close(cur_tabpage) - end - - local mode_unsupported_focus = mode == "drop" or mode == "tab_drop" or mode == "edit_in_place" - local focus = edit_opts.focus == nil or edit_opts.focus == true - if not mode_unsupported_focus and not focus then - -- if mode == "tabnew" a new tab will be opened and we need to focus back to the previous tab - if mode == "tabnew" then - vim.cmd(":tabprev") - end - view.focus() - end -end - ----@param mode string ----@param toggle_group boolean? ----@return fun(node: Node, edit_opts: NodeEditOpts?) -local function open_or_expand_or_dir_up(mode, toggle_group) - ---@param node Node - ---@param edit_opts NodeEditOpts? - return function(node, edit_opts) - local root = node:as(RootNode) - local dir = node:as(DirectoryNode) - - if root or node.name == ".." then - wrap_explorer("change_dir")("..") - elseif dir then - dir:expand_or_collapse(toggle_group) - elseif not toggle_group then - edit(mode, node, edit_opts) - end - end -end - ---Re-Hydrate api functions and classes post-setup ---@param api table not properly typed to prevent LSP from referencing implementations function M.hydrate(api) @@ -152,7 +96,7 @@ function M.hydrate(api) api.tree.resize = actions.tree.resize.fn - api.tree.change_root = require("nvim-tree").change_dir + api.tree.change_root = actions.tree.change_dir.fn api.tree.change_root_to_node = wrap_node(wrap_explorer("change_dir_to_node")) api.tree.change_root_to_parent = wrap_node(wrap_explorer("dir_up")) @@ -175,11 +119,11 @@ function M.hydrate(api) api.fs.create = wrap_node_or_nil(actions.fs.create_file.fn) api.fs.remove = wrap_node(actions.fs.remove_file.fn) api.fs.trash = wrap_node(actions.fs.trash.fn) - api.fs.rename_node = wrap_node(actions.fs.rename_file.fn(":t")) - api.fs.rename = wrap_node(actions.fs.rename_file.fn(":t")) - api.fs.rename_sub = wrap_node(actions.fs.rename_file.fn(":p:h")) - api.fs.rename_basename = wrap_node(actions.fs.rename_file.fn(":t:r")) - api.fs.rename_full = wrap_node(actions.fs.rename_file.fn(":p")) + api.fs.rename_node = wrap_node(actions.fs.rename_file.rename_node) + api.fs.rename = wrap_node(actions.fs.rename_file.rename_node) + api.fs.rename_sub = wrap_node(actions.fs.rename_file.rename_sub) + api.fs.rename_basename = wrap_node(actions.fs.rename_file.rename_basename) + api.fs.rename_full = wrap_node(actions.fs.rename_file.rename_full) api.fs.cut = wrap_node(wrap_explorer_member("clipboard", "cut")) api.fs.paste = wrap_node(wrap_explorer_member("clipboard", "paste")) api.fs.clear_clipboard = wrap_explorer_member("clipboard", "clear_clipboard") @@ -190,42 +134,46 @@ function M.hydrate(api) api.fs.copy.basename = wrap_node(wrap_explorer_member("clipboard", "copy_basename")) api.fs.copy.relative_path = wrap_node(wrap_explorer_member("clipboard", "copy_path")) - api.node.open.edit = wrap_node(open_or_expand_or_dir_up("edit")) - api.node.open.drop = wrap_node(open_or_expand_or_dir_up("drop")) - api.node.open.tab_drop = wrap_node(open_or_expand_or_dir_up("tab_drop")) - api.node.open.replace_tree_buffer = wrap_node(open_or_expand_or_dir_up("edit_in_place")) - api.node.open.no_window_picker = wrap_node(open_or_expand_or_dir_up("edit_no_picker")) - api.node.open.vertical = wrap_node(open_or_expand_or_dir_up("vsplit")) - api.node.open.vertical_no_picker = wrap_node(open_or_expand_or_dir_up("vsplit_no_picker")) - api.node.open.horizontal = wrap_node(open_or_expand_or_dir_up("split")) - api.node.open.horizontal_no_picker = wrap_node(open_or_expand_or_dir_up("split_no_picker")) - api.node.open.tab = wrap_node(open_or_expand_or_dir_up("tabnew")) - api.node.open.toggle_group_empty = wrap_node(open_or_expand_or_dir_up("toggle_group_empty", true)) - api.node.open.preview = wrap_node(open_or_expand_or_dir_up("preview")) - api.node.open.preview_no_picker = wrap_node(open_or_expand_or_dir_up("preview_no_picker")) + api.node.open.edit = wrap_node(actions.node.open_file.edit) + api.node.open.drop = wrap_node(actions.node.open_file.drop) + api.node.open.tab_drop = wrap_node(actions.node.open_file.tab_drop) + api.node.open.replace_tree_buffer = wrap_node(actions.node.open_file.replace_tree_buffer) + api.node.open.no_window_picker = wrap_node(actions.node.open_file.no_window_picker) + api.node.open.vertical = wrap_node(actions.node.open_file.vertical) + api.node.open.vertical_no_picker = wrap_node(actions.node.open_file.vertical_no_picker) + api.node.open.horizontal = wrap_node(actions.node.open_file.horizontal) + api.node.open.horizontal_no_picker = wrap_node(actions.node.open_file.horizontal_no_picker) + api.node.open.tab = wrap_node(actions.node.open_file.tab) + api.node.open.toggle_group_empty = wrap_node(actions.node.open_file.toggle_group_empty) + api.node.open.preview = wrap_node(actions.node.open_file.preview) + api.node.open.preview_no_picker = wrap_node(actions.node.open_file.preview_no_picker) api.node.show_info_popup = wrap_node(actions.node.file_popup.toggle_file_info) api.node.run.cmd = wrap_node(actions.node.run_command.run_file_command) api.node.run.system = wrap_node(actions.node.system_open.fn) - api.node.navigate.sibling.next = wrap_node(actions.moves.sibling.fn("next")) - api.node.navigate.sibling.prev = wrap_node(actions.moves.sibling.fn("prev")) - api.node.navigate.sibling.first = wrap_node(actions.moves.sibling.fn("first")) - api.node.navigate.sibling.last = wrap_node(actions.moves.sibling.fn("last")) - api.node.navigate.parent = wrap_node(actions.moves.parent.fn(false)) - api.node.navigate.parent_close = wrap_node(actions.moves.parent.fn(true)) - api.node.navigate.git.next = wrap_node(actions.moves.item.fn({ where = "next", what = "git" })) - api.node.navigate.git.next_skip_gitignored = wrap_node(actions.moves.item.fn({ where = "next", what = "git", skip_gitignored = true })) - api.node.navigate.git.next_recursive = wrap_node(actions.moves.item.fn({ where = "next", what = "git", recurse = true })) - api.node.navigate.git.prev = wrap_node(actions.moves.item.fn({ where = "prev", what = "git" })) - api.node.navigate.git.prev_skip_gitignored = wrap_node(actions.moves.item.fn({ where = "prev", what = "git", skip_gitignored = true })) - api.node.navigate.git.prev_recursive = wrap_node(actions.moves.item.fn({ where = "prev", what = "git", recurse = true })) - api.node.navigate.diagnostics.next = wrap_node(actions.moves.item.fn({ where = "next", what = "diag" })) - api.node.navigate.diagnostics.next_recursive = wrap_node(actions.moves.item.fn({ where = "next", what = "diag", recurse = true })) - api.node.navigate.diagnostics.prev = wrap_node(actions.moves.item.fn({ where = "prev", what = "diag" })) - api.node.navigate.diagnostics.prev_recursive = wrap_node(actions.moves.item.fn({ where = "prev", what = "diag", recurse = true })) - api.node.navigate.opened.next = wrap_node(actions.moves.item.fn({ where = "next", what = "opened" })) - api.node.navigate.opened.prev = wrap_node(actions.moves.item.fn({ where = "prev", what = "opened" })) + api.node.navigate.sibling.next = wrap_node(actions.moves.sibling.next) + api.node.navigate.sibling.prev = wrap_node(actions.moves.sibling.prev) + api.node.navigate.sibling.first = wrap_node(actions.moves.sibling.first) + api.node.navigate.sibling.last = wrap_node(actions.moves.sibling.last) + + api.node.navigate.parent = wrap_node(actions.moves.parent.move) + api.node.navigate.parent_close = wrap_node(actions.moves.parent.move_close) + + api.node.navigate.git.next = actions.moves.item.git_next + api.node.navigate.git.next_skip_gitignored = actions.moves.item.git_next_skip_gitignored + api.node.navigate.git.next_recursive = actions.moves.item.git_next_recursive + api.node.navigate.git.prev = actions.moves.item.git_prev + api.node.navigate.git.prev_skip_gitignored = actions.moves.item.git_prev_skip_gitignored + api.node.navigate.git.prev_recursive = actions.moves.item.git_prev_recursive + + api.node.navigate.diagnostics.next = actions.moves.item.diagnostics_next + api.node.navigate.diagnostics.next_recursive = actions.moves.item.diagnostics_next_recursive + api.node.navigate.diagnostics.prev = actions.moves.item.diagnostics_prev + api.node.navigate.diagnostics.prev_recursive = actions.moves.item.diagnostics_prev_recursive + + api.node.navigate.opened.next = actions.moves.item.opened_next + api.node.navigate.opened.prev = actions.moves.item.opened_prev api.node.expand = wrap_node(wrap_explorer("expand_node")) api.node.collapse = wrap_node(actions.tree.collapse.node)