diff --git a/ui/chat_ui.gd b/ui/chat_ui.gd index c79d80c..d43d212 100644 --- a/ui/chat_ui.gd +++ b/ui/chat_ui.gd @@ -893,8 +893,9 @@ func _on_entry_text_submitted(_value: String) -> void: func _send() -> void: if _send_pending: return - var body := _entry.text - if body.strip_edges().is_empty(): + var strippable_spaces := RegEx.create_from_string("(^\\s+|\\s+$)") + var body := strippable_spaces.sub(_entry.text, "", true) + if body.is_empty(): close_chat() return _send_pending = true