don't order icons
This commit is contained in:
@@ -248,17 +248,10 @@ function Builder:_build_line(node, idx, num_children)
|
||||
local git_highlight = git.get_highlight(node)
|
||||
local git_icons_tbl = git.get_icons(node)
|
||||
|
||||
if git_icons_tbl and #git_icons_tbl > 0 then
|
||||
if self.is_git_sign then
|
||||
local git_info = git_icons_tbl[1]
|
||||
table.insert(self.signs, { sign = git_info.hl, lnum = self.index + 1 })
|
||||
git_icons_tbl = {}
|
||||
else
|
||||
-- sort icons so it looks slightly better
|
||||
table.sort(git_icons_tbl, function(a, b)
|
||||
return a.ord < b.ord
|
||||
end)
|
||||
end
|
||||
if git_icons_tbl and #git_icons_tbl > 0 and self.is_git_sign then
|
||||
local git_info = git_icons_tbl[1]
|
||||
table.insert(self.signs, { sign = git_info.hl, lnum = self.index + 1 })
|
||||
git_icons_tbl = {}
|
||||
end
|
||||
|
||||
local is_folder = node.nodes ~= nil
|
||||
|
||||
@@ -7,13 +7,13 @@ local M = {
|
||||
|
||||
local function build_icons_table(i)
|
||||
local icons = {
|
||||
staged = { icon = i.staged, hl = "NvimTreeGitStaged", ord = 1 },
|
||||
unstaged = { icon = i.unstaged, hl = "NvimTreeGitDirty", ord = 2 },
|
||||
renamed = { icon = i.renamed, hl = "NvimTreeGitRenamed", ord = 3 },
|
||||
deleted = { icon = i.deleted, hl = "NvimTreeGitDeleted", ord = 4 },
|
||||
unmerged = { icon = i.unmerged, hl = "NvimTreeGitMerge", ord = 5 },
|
||||
untracked = { icon = i.untracked, hl = "NvimTreeGitNew", ord = 6 },
|
||||
ignored = { icon = i.ignored, hl = "NvimTreeGitIgnored", ord = 7 },
|
||||
staged = { icon = i.staged, hl = "NvimTreeGitStaged" },
|
||||
unstaged = { icon = i.unstaged, hl = "NvimTreeGitDirty" },
|
||||
renamed = { icon = i.renamed, hl = "NvimTreeGitRenamed" },
|
||||
deleted = { icon = i.deleted, hl = "NvimTreeGitDeleted" },
|
||||
unmerged = { icon = i.unmerged, hl = "NvimTreeGitMerge" },
|
||||
untracked = { icon = i.untracked, hl = "NvimTreeGitNew" },
|
||||
ignored = { icon = i.ignored, hl = "NvimTreeGitIgnored" },
|
||||
}
|
||||
return {
|
||||
["M "] = { icons.staged },
|
||||
|
||||
Reference in New Issue
Block a user