Skip to content

Commit b356540

Browse files
committed
fix(filesystem): handle hide_gitignored=false properly, fixes #407
1 parent e3fec64 commit b356540

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

lua/neo-tree/git/ignored.lua

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,12 +87,14 @@ M.mark_ignored = function(state, items)
8787
vim.list_extend(all_results, result)
8888
end
8989

90-
log.trace("IGNORED: Comparing results to mark items as ignored")
90+
local show_anyway = state.filtered_items and state.filtered_items.hide_gitignored == false
91+
log.trace("IGNORED: Comparing results to mark items as ignored, show_anyway:", show_anyway)
9192
local ignored, not_ignored = 0, 0
9293
for _, item in ipairs(items) do
9394
if M.is_ignored(all_results, item.path, item.type) then
9495
item.filtered_by = item.filtered_by or {}
9596
item.filtered_by.gitignored = true
97+
item.filtered_by.show_anyway = show_anyway
9698
ignored = ignored + 1
9799
else
98100
not_ignored = not_ignored + 1

lua/neo-tree/log.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,8 @@ log.new = function(config, standalone)
123123
x = tostring(round(x, config.float_precision))
124124
elseif type(x) == "table" then
125125
x = vim.inspect(x)
126-
if #x > 200 then
127-
x = x:sub(1, 200) .. "..."
126+
if #x > 300 then
127+
x = x:sub(1, 300) .. "..."
128128
end
129129
else
130130
x = tostring(x)

lua/neo-tree/ui/renderer.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ local remove_filtered = function(source_items, filtered_items)
138138
local hidden = {}
139139
for _, child in ipairs(source_items) do
140140
local fby = child.filtered_by
141-
if type(fby) == "table" and not child.is_reveal_target then
141+
if type(fby) == "table" and not child.is_reveal_target and not fby.show_anyway then
142142
if not fby.never_show then
143143
if filtered_items.visible or child.is_nested then
144144
table.insert(visible, child)

0 commit comments

Comments
 (0)