chore(refacto): move parent and sibling functions into actions

BREAKING CHANGE:
- move parent_node and sibling functions from lib to
  actions/movements.lua.
This commit is contained in:
kiyan
2022-02-05 17:08:11 +01:00
parent 96650c801f
commit 8c4fd519b6
3 changed files with 109 additions and 98 deletions

View File

@@ -65,15 +65,15 @@ local keypress_funcs = {
cut = require'nvim-tree.actions.copy-paste'.cut,
paste = require'nvim-tree.actions.copy-paste'.paste,
close_node = lib.close_node,
parent_node = lib.parent_node,
parent_node = require'nvim-tree.actions.movements'.parent_node,
toggle_ignored = lib.toggle_ignored,
toggle_dotfiles = lib.toggle_dotfiles,
toggle_help = lib.toggle_help,
refresh = lib.refresh_tree,
first_sibling = function(node) lib.sibling(node, -math.huge) end,
last_sibling = function(node) lib.sibling(node, math.huge) end,
prev_sibling = function(node) lib.sibling(node, -1) end,
next_sibling = function(node) lib.sibling(node, 1) end,
first_sibling = require'nvim-tree.actions.movements'.sibling(-math.huge),
last_sibling = require'nvim-tree.actions.movements'.sibling(math.huge),
prev_sibling = require'nvim-tree.actions.movements'.sibling(-1),
next_sibling = require'nvim-tree.actions.movements'.sibling(1),
prev_git_item = go_to('prev_git_item'),
next_git_item = go_to('next_git_item'),
dir_up = lib.dir_up,