refacto: move toggle help and filter toggles into actions

also fix explorer to properly remove element on update when filter is
applied
This commit is contained in:
kiyan
2022-02-07 20:43:24 +01:00
parent 230a61db91
commit 47ccc2913f
6 changed files with 40 additions and 33 deletions

View File

@@ -1,6 +1,7 @@
local utils = require'nvim-tree.utils'
local view = require'nvim-tree.view'
local diagnostics = require'nvim-tree.diagnostics'
local config = require"nvim-tree.config"
local lib = function() return require'nvim-tree.lib' end
local M = {}
@@ -103,4 +104,13 @@ function M.sibling(direction)
end
end
function M.find_git_item(where)
local icon_state = config.get_icon_state()
local flags = where == 'next' and 'b' or ''
local icons = table.concat(vim.tbl_values(icon_state.icons.git_icons), '\\|')
return function()
return icon_state.show_git_icon and vim.fn.search(icons, flags)
end
end
return M