Skip to content

Only renders the git icon if the icon is not empty #633

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 1 commit into from
Sep 25, 2021
Merged
Changes from all commits
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
6 changes: 4 additions & 2 deletions lua/nvim-tree/renderer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,10 @@ if icon_state.show_git_icon then
icons = git_icon_state.dirty
end
for _, v in ipairs(icons) do
table.insert(hl, { v.hl, line, depth+icon_len+#icon, depth+icon_len+#icon+#v.icon })
icon = icon..v.icon..icon_padding
if #v.icon > 0 then
table.insert(hl, { v.hl, line, depth+icon_len+#icon, depth+icon_len+#icon+#v.icon })
icon = icon..v.icon..icon_padding
end
end

return icon
Expand Down