sort icon only if not git signcolumn
This commit is contained in:
@@ -248,10 +248,17 @@ function Builder:_build_line(node, idx, num_children)
|
|||||||
local git_highlight = git.get_highlight(node)
|
local git_highlight = git.get_highlight(node)
|
||||||
local git_icons_tbl = git.get_icons(node)
|
local git_icons_tbl = git.get_icons(node)
|
||||||
|
|
||||||
if self.is_git_sign and git_icons_tbl and #git_icons_tbl > 0 then
|
if git_icons_tbl and #git_icons_tbl > 0 then
|
||||||
|
if self.is_git_sign then
|
||||||
local git_info = git_icons_tbl[1]
|
local git_info = git_icons_tbl[1]
|
||||||
table.insert(self.signs, { sign = git_info.hl, lnum = self.index + 1 })
|
table.insert(self.signs, { sign = git_info.hl, lnum = self.index + 1 })
|
||||||
git_icons_tbl = {}
|
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
|
||||||
end
|
end
|
||||||
|
|
||||||
local is_folder = node.nodes ~= nil
|
local is_folder = node.nodes ~= nil
|
||||||
|
|||||||
@@ -85,10 +85,6 @@ local function get_icons_(node)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
table.sort(iconss, function(a, b)
|
|
||||||
return a.ord < b.ord
|
|
||||||
end)
|
|
||||||
|
|
||||||
return iconss
|
return iconss
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user