Skip to content

Improve git icons on directories #1809

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 16 commits into from
Dec 17, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fixed #1784 conflict
  • Loading branch information
chomosuke committed Dec 13, 2022
commit c4b93dbae9f1f94d5fc837aa80d8205deac4201a
6 changes: 4 additions & 2 deletions lua/nvim-tree/explorer/filters.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,17 @@ local function git(path, git_status)
end

-- default status to clean
local status = git_status.files[path] or git_status.dirs[path] or " "
local status = git_status.files[path]
status = status or git_status.dirs.direct[path] and git_status.dirs.direct[path][1]
status = status or git_status.dirs.indirect[path] and git_status.dirs.indirect[path][1]

-- filter ignored; overrides clean as they are effectively dirty
if M.config.filter_git_ignored and status == "!!" then
return true
end

-- filter clean
if M.config.filter_git_clean and status == " " then
if M.config.filter_git_clean and not status then
return true
end

Expand Down