Fix crash when EditLine receives a paste from clipboard

This commit is contained in:
2022-10-07 20:32:18 -05:00
parent 2e66509f87
commit 2fd5d398cf

View File

@@ -126,9 +126,9 @@ module CyberarmEngine
when Gosu::KB_V when Gosu::KB_V
if instance_of?(EditLine) # EditLine assumes a single line of text if instance_of?(EditLine) # EditLine assumes a single line of text
@text_input.insert_text(Gosu.clipboard.encode("UTF-8").gsub("\n", "")) @text_input.insert_text(Gosu.clipboard.gsub("\n", ""))
else else
@text_input.insert_text(Gosu.clipboard.encode("UTF-8")) @text_input.insert_text(Gosu.clipboard)
end end
end end
end end