From 72d4a5d4b86f7bbf2b84ecc4e4c232bb5c4f3859 Mon Sep 17 00:00:00 2001 From: Jean-Patrick Guerrero Date: Thu, 23 Jun 2022 13:04:19 +0200 Subject: [PATCH] Minor cleaning --- src/fields.lua | 2 +- src/gui.lua | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/fields.lua b/src/fields.lua index f819720..2fe2857 100644 --- a/src/fields.lua +++ b/src/fields.lua @@ -369,7 +369,7 @@ local function rcp_fields(player, data, fields) local fav = is_fav(data) if #data.favs < i3.settings.max_favs and not fav then - insert(data.favs, fmt("_%s", data.query_item)) + insert(data.favs, data.query_item) elseif fav then remove(data.favs, fav) end diff --git a/src/gui.lua b/src/gui.lua index 61d663a..dbdbd1a 100644 --- a/src/gui.lua +++ b/src/gui.lua @@ -1397,9 +1397,8 @@ local function get_favs(fs, data) local btn_size = i3.settings.item_btn_size label(data.inv_width + 0.4, data.yoffset + 0.4, ES"Bookmarks") - for i = 1, #data.favs do - local name = data.favs[i] - local item = sub(name, 2) + for i, item in ipairs(data.favs) do + local name = fmt("_%s", item) local X = data.inv_width - 0.7 + (i * 1.2) local Y = data.yoffset + 0.8