From 06b813319aeefd79b88c564e8c019581f1ad2fe0 Mon Sep 17 00:00:00 2001 From: Halavus Nenuli Date: Fri, 6 Mar 2026 05:21:27 +0100 Subject: [PATCH 1/2] ignore language_name_component NONE element with value -1 added a break in the 2 concerned for loops --- gui/rename.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/gui/rename.lua b/gui/rename.lua index 49f918c7f..5230b9664 100644 --- a/gui/rename.lua +++ b/gui/rename.lua @@ -605,6 +605,7 @@ function Rename:get_component_choices() }, data={val=df.language_name_component.TheX, is_first_name=true}}) for val, comp in ipairs(df.language_name_component) do + if val < 0 then goto continue end -- ignore language_name_component NONE element with value -1 local text = { {text=comp:gsub('(%l)(%u)', '%1 %2')}, NEWLINE, {gap=2, pen=COLOR_YELLOW, text=function() @@ -614,6 +615,8 @@ function Rename:get_component_choices() end}, } table.insert(choices, {text=text, data={val=val}}) + + ::continue:: end return choices end @@ -632,7 +635,8 @@ function Rename:get_component_action_choices() table.insert(choices, {text='', data={fn=function() end}}) local randomize_text = {{text='[', pen=COLOR_RED}, 'Random', {text=']', pen=COLOR_RED}} - for comp in ipairs(df.language_name_component) do + for val, comp in ipairs(df.language_name_component) do + if val < 0 then goto continue end -- ignore language_name_component NONE element with value -1 local randomize_fn = self:callback('randomize_component_word', comp) table.insert(choices, {text=randomize_text, data={fn=randomize_fn}}) local clear_text = { @@ -643,6 +647,8 @@ function Rename:get_component_action_choices() local clear_fn = self:callback('clear_component_word', comp) table.insert(choices, {text=clear_text, data={fn=clear_fn}}) table.insert(choices, {text='', data={fn=function() end}}) + + ::continue:: end return choices end From 3175d6f24122aff13812894535466135f3cfdd54 Mon Sep 17 00:00:00 2001 From: Halavus Nenuli Date: Fri, 6 Mar 2026 10:09:52 +0100 Subject: [PATCH 2/2] Fix tabs issues in rename.lua --- gui/rename.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gui/rename.lua b/gui/rename.lua index 5230b9664..8737eb7f8 100644 --- a/gui/rename.lua +++ b/gui/rename.lua @@ -636,7 +636,7 @@ function Rename:get_component_action_choices() local randomize_text = {{text='[', pen=COLOR_RED}, 'Random', {text=']', pen=COLOR_RED}} for val, comp in ipairs(df.language_name_component) do - if val < 0 then goto continue end -- ignore language_name_component NONE element with value -1 + if val < 0 then goto continue end -- ignore language_name_component NONE element with value -1 local randomize_fn = self:callback('randomize_component_word', comp) table.insert(choices, {text=randomize_text, data={fn=randomize_fn}}) local clear_text = {