Skip to content

Commit 57ad40f

Browse files
committed
fix: fix: keeping order of tags within the panel
Due to lua pairs doesn't keep the order of the elements, the tags list within the panel didn't keep the order properly. This PR fix that, iterating by the letters of the dictionary and printing the tags keeping the order.
1 parent d76fe37 commit 57ad40f

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

lua/tide/render.lua

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,12 @@ M.render = function()
2929

3030
local unique_names = utils.generate_unique_names(files)
3131

32-
for tag, file in pairs(state.current_state.tags) do
33-
state.current_state.tags[tag] = file
34-
M.render_file(utils.get_icon(file), unique_names[file], tag)
32+
for letter in state.options.hints.dictionary:gmatch(".") do
33+
local file = state.current_state.tags[letter]
34+
if file == nil then
35+
break
36+
end
37+
M.render_file(utils.get_icon(file), unique_names[file], letter)
3538
end
3639

3740
for _ = state.current_state.linenr, state.current_state.height - MENU_HEIGHT do

0 commit comments

Comments
 (0)