File tree Expand file tree Collapse file tree 3 files changed +18
-4
lines changed
Expand file tree Collapse file tree 3 files changed +18
-4
lines changed Original file line number Diff line number Diff line change @@ -128,6 +128,20 @@ function M.is_git_ignored(node)
128128 return node and node .git_status ~= nil and node .git_status .file == " !!"
129129end
130130
131+ --- @param node Node
132+ --- @return boolean
133+ function M .is_dotfile (node )
134+ if node == nil then
135+ return false
136+ end
137+ -- Inspect(node)
138+ if node .is_dot or (node .name and (node .name :sub (1 , 1 ) == " ." )) or M .is_dotfile (node .parent ) then
139+ node .is_dot = true
140+ return true
141+ end
142+ return false
143+ end
144+
131145--- @param node Node
132146function M .node_destroy (node )
133147 if not node then
Original file line number Diff line number Diff line change 99--- @field fs_stat uv.fs_stat.result | nil
1010--- @field git_status GitStatus | nil
1111--- @field hidden boolean
12+ --- @field is_dot boolean
1213--- @field name string
1314--- @field parent DirNode
1415--- @field type string
Original file line number Diff line number Diff line change 1- local buffers = require " nvim-tree.buffers"
2-
1+ local is_dotfile = require (" nvim-tree.explorer.node" ).is_dotfile
32local HL_POSITION = require (" nvim-tree.enum" ).HL_POSITION
43local ICON_PLACEMENT = require (" nvim-tree.enum" ).ICON_PLACEMENT
54
3837--- @param node Node
3938--- @return HighlightedString[] | nil icons
4039function DecoratorHidden :calculate_icons (node )
41- if self .enabled and (node . name : sub ( 1 , 1 ) == " . " ) then
40+ if self .enabled and is_dotfile (node ) then
4241 return { self .icon }
4342 end
4443end
4746--- @param node Node
4847--- @return string | nil group
4948function DecoratorHidden :calculate_highlight (node )
50- if not self .enabled or self .hl_pos == HL_POSITION .none or not (node . name : sub ( 1 , 1 ) == " . " ) then
49+ if not self .enabled or self .hl_pos == HL_POSITION .none or not (is_dotfile ( node ) ) then
5150 return nil
5251 end
5352
You can’t perform that action at this time.
0 commit comments