diff options
author | ouwou <26526779+ouwou@users.noreply.github.com> | 2021-04-15 02:45:22 -0400 |
---|---|---|
committer | ouwou <26526779+ouwou@users.noreply.github.com> | 2021-04-15 02:45:22 -0400 |
commit | 5d95daaeca46642c68dcef8aa42b3508d4d2a34a (patch) | |
tree | 91016342aa2d83d03e51f771182279935581d62a /components | |
parent | cd8cd97c9b1fb297f4bf455135d0e0e690358c53 (diff) | |
download | abaddon-portaudio-5d95daaeca46642c68dcef8aa42b3508d4d2a34a.tar.gz abaddon-portaudio-5d95daaeca46642c68dcef8aa42b3508d4d2a34a.zip |
make enter key behave better in chat input
Diffstat (limited to 'components')
-rw-r--r-- | components/chatinput.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/components/chatinput.cpp b/components/chatinput.cpp index 7ac4e72..c3eca32 100644 --- a/components/chatinput.cpp +++ b/components/chatinput.cpp @@ -42,13 +42,12 @@ bool ChatInput::ProcessKeyPress(GdkEventKey *event) { auto buf = GetBuffer(); auto text = buf->get_text(); - // sometimes a message thats just newlines can sneak in if you hold down enter - if (text.size() > 0 && !std::all_of(text.begin(), text.end(), [](gunichar c) -> bool { return c == gunichar('\n'); })) { - const bool accepted = m_signal_submit.emit(text); - if (accepted) - buf->set_text(""); - return true; - } + + const bool accepted = m_signal_submit.emit(text); + if (accepted) + buf->set_text(""); + + return true; } return false; |