From 1980fefa50a63e09f6793c840aeb1a87c03f6699 Mon Sep 17 00:00:00 2001 From: Jean-Patrick Guerrero Date: Sun, 12 Jul 2020 22:46:28 +0200 Subject: [PATCH] Fix replacement tooltip --- init.lua | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/init.lua b/init.lua index 09c4a4d..ad2190a 100644 --- a/init.lua +++ b/init.lua @@ -1027,12 +1027,16 @@ local function get_grid_fs(lang_code, fs, rcp, spacing) local replace if rcp.replacements then - replace = {} - label = fmt("%s%s\nR", label ~= "" and "\n" or "", label) - for j = 1, #rcp.replacements do local replacement = rcp.replacements[j] if replacement[1] == name then + replace = replace or {} + + if j == 1 then + label = fmt("%s%s\nR", + label ~= "" and "\n" or "", label) + end + replace[#replace + 1] = replacement[2] end end