nvim-tree.lua/lua/nvim-tree/actions/tree/modifiers/toggles.lua
Azad f779abaf2a
refactor: improve API readability and tidy actions submodules (#2593)
* refactor: improve API readability, tidy actions modules

* Apply requested changes

* `actions/reloaders/reloaders.lua` -> `actions/reloaders.lua`

---------

Co-authored-by: Alexander Courtis <alex@courtis.org>
2023-12-31 15:52:27 +11:00

45 lines
1009 B
Lua

local lib = require "nvim-tree.lib"
local utils = require "nvim-tree.utils"
local filters = require "nvim-tree.explorer.filters"
local reloaders = require "nvim-tree.actions.reloaders"
local M = {}
local function reload()
local node = lib.get_node_at_cursor()
reloaders.reload_explorer()
utils.focus_node_or_parent(node)
end
function M.custom()
filters.config.filter_custom = not filters.config.filter_custom
reload()
end
function M.git_ignored()
filters.config.filter_git_ignored = not filters.config.filter_git_ignored
reload()
end
function M.git_clean()
filters.config.filter_git_clean = not filters.config.filter_git_clean
reload()
end
function M.no_buffer()
filters.config.filter_no_buffer = not filters.config.filter_no_buffer
reload()
end
function M.no_bookmark()
filters.config.filter_no_bookmark = not filters.config.filter_no_bookmark
reload()
end
function M.dotfiles()
filters.config.filter_dotfiles = not filters.config.filter_dotfiles
reload()
end
return M