@@ -605,6 +605,7 @@ function Rename:get_component_choices()
605605 },
606606 data = {val = df .language_name_component .TheX , is_first_name = true }})
607607 for val , comp in ipairs (df .language_name_component ) do
608+ if val < 0 then goto continue end -- ignore language_name_component NONE element with value -1
608609 local text = {
609610 {text = comp :gsub (' (%l)(%u)' , ' %1 %2' )}, NEWLINE ,
610611 {gap = 2 , pen = COLOR_YELLOW , text = function ()
@@ -614,6 +615,8 @@ function Rename:get_component_choices()
614615 end },
615616 }
616617 table.insert (choices , {text = text , data = {val = val }})
618+
619+ :: continue::
617620 end
618621 return choices
619622end
@@ -632,7 +635,8 @@ function Rename:get_component_action_choices()
632635 table.insert (choices , {text = ' ' , data = {fn = function () end }})
633636
634637 local randomize_text = {{text = ' [' , pen = COLOR_RED }, ' Random' , {text = ' ]' , pen = COLOR_RED }}
635- for comp in ipairs (df .language_name_component ) do
638+ for val , comp in ipairs (df .language_name_component ) do
639+ if val < 0 then goto continue end -- ignore language_name_component NONE element with value -1
636640 local randomize_fn = self :callback (' randomize_component_word' , comp )
637641 table.insert (choices , {text = randomize_text , data = {fn = randomize_fn }})
638642 local clear_text = {
@@ -643,6 +647,8 @@ function Rename:get_component_action_choices()
643647 local clear_fn = self :callback (' clear_component_word' , comp )
644648 table.insert (choices , {text = clear_text , data = {fn = clear_fn }})
645649 table.insert (choices , {text = ' ' , data = {fn = function () end }})
650+
651+ :: continue::
646652 end
647653 return choices
648654end
0 commit comments