sorted icons

This commit is contained in:
chomosuke
2022-12-06 22:15:06 +11:00
parent 5c6acd554e
commit 75cd0d1a6d

View File

@@ -7,13 +7,13 @@ local M = {
local function build_icons_table(i)
local icons = {
staged = { icon = i.staged, hl = "NvimTreeGitStaged" },
unstaged = { icon = i.unstaged, hl = "NvimTreeGitDirty" },
untracked = { icon = i.untracked, hl = "NvimTreeGitNew" },
unmerged = { icon = i.unmerged, hl = "NvimTreeGitMerge" },
renamed = { icon = i.renamed, hl = "NvimTreeGitRenamed" },
deleted = { icon = i.deleted, hl = "NvimTreeGitDeleted" },
ignored = { icon = i.ignored, hl = "NvimTreeGitIgnored" },
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 },
}
return {
["M "] = { icons.staged },
@@ -85,6 +85,8 @@ local function get_icons_(node)
end
end
table.sort(iconss, function(a, b) return a.ord < b.ord end)
return iconss
end