From e270e77a75a2fa1613bdd2b62383563b0504ad50 Mon Sep 17 00:00:00 2001 From: Francesc Arpi Roca Date: Wed, 4 Dec 2024 07:06:23 +0100 Subject: [PATCH] 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. --- lua/tide/render.lua | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lua/tide/render.lua b/lua/tide/render.lua index fe6d108..cc67d01 100644 --- a/lua/tide/render.lua +++ b/lua/tide/render.lua @@ -29,9 +29,11 @@ M.render = function() local unique_names = utils.generate_unique_names(files) - for tag, file in pairs(state.current_state.tags) do - state.current_state.tags[tag] = file - M.render_file(utils.get_icon(file), unique_names[file], tag) + for letter in state.options.hints.dictionary:gmatch(".") do + local file = state.current_state.tags[letter] + if file then + M.render_file(utils.get_icon(file), unique_names[file], letter) + end end for _ = state.current_state.linenr, state.current_state.height - MENU_HEIGHT do