Skip to content
This repository has been archived by the owner on Sep 20, 2023. It is now read-only.

Commit

Permalink
simplify code a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
famiu committed Sep 27, 2021
1 parent f119c00 commit d31f3cf
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lua/feline/generator.lua
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,10 @@ function M.generate_statusline(winid)
if statusline_length > win_width then
table.sort(component_indices, function(a, b)
-- Access the original component through the sections table using the indices
return (sections[a[1]][a[2]].priority or 0) < (sections[b[1]][b[2]].priority or 0)
local first_component_priority = sections[a[1]][a[2]].priority or 0
local second_component_priority = sections[b[1]][b[2]].priority or 0

return first_component_priority < second_component_priority
end)

for _, indices in ipairs(component_indices) do
Expand Down

0 comments on commit d31f3cf

Please sign in to comment.