Feat: Allow hiding dotfiles (#69)

This commit is contained in:
Kieran Siek
2020-08-03 22:13:25 +08:00
committed by GitHub
parent 1aee593b5d
commit 06558a25da
7 changed files with 55 additions and 33 deletions

View File

@@ -6,7 +6,8 @@ local api = vim.api
local luv = vim.loop
local M = {
show_ignored = false
show_ignored = false,
show_dotfiles = vim.g.lua_tree_hide_dotfiles ~= 1,
}
local path_to_matching_str = require'lib.utils'.path_to_matching_str
@@ -65,7 +66,9 @@ local function gen_ignore_check()
end
return function(path)
return not M.show_ignored and ignore_list[path] == true
local ignore_path = not M.show_ignored and ignore_list[path] == true
local ignore_dotfiles = not M.show_dotfiles and path:sub(1, 1) == '.'
return ignore_path or ignore_dotfiles
end
end