diff options
author | Nicolas Werner <nicolas.werner@hotmail.de> | 2020-11-25 02:20:42 +0100 |
---|---|---|
committer | Nicolas Werner <nicolas.werner@hotmail.de> | 2020-11-25 19:05:12 +0100 |
commit | 0eb8d4126b50a2e7d11998dbe60a8d04035827f8 (patch) | |
tree | 849cf31985988a9273a1d80b547488f8e70e60e7 /resources | |
parent | Remove redundant user search suggestion code (diff) | |
download | nheko-0eb8d4126b50a2e7d11998dbe60a8d04035827f8.tar.xz |
Fix enter when no completion available
Diffstat (limited to 'resources')
-rw-r--r-- | resources/qml/MessageInput.qml | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/resources/qml/MessageInput.qml b/resources/qml/MessageInput.qml index 7a033f5b..76eac5b3 100644 --- a/resources/qml/MessageInput.qml +++ b/resources/qml/MessageInput.qml @@ -117,15 +117,20 @@ Rectangle { popup.completerName = ""; event.accepted = true; popup.close(); - } else if (event.matches(StandardKey.InsertParagraphSeparator) && popup.opened) { - var currentCompletion = popup.currentCompletion(); - popup.completerName = ""; - popup.close(); - if (currentCompletion) { - textArea.insertCompletion(currentCompletion); - event.accepted = true; - return ; + } else if (event.matches(StandardKey.InsertParagraphSeparator)) { + if (popup.opened) { + var currentCompletion = popup.currentCompletion(); + popup.completerName = ""; + popup.close(); + if (currentCompletion) { + textArea.insertCompletion(currentCompletion); + event.accepted = true; + return ; + } } + TimelineManager.timeline.input.send(); + textArea.clear(); + event.accepted = true; } else if (event.key == Qt.Key_Tab && popup.opened) { event.accepted = true; popup.down(); @@ -135,10 +140,6 @@ Rectangle { } else if (event.key == Qt.Key_Down && popup.opened) { event.accepted = true; popup.down(); - } else if (event.matches(StandardKey.InsertParagraphSeparator)) { - TimelineManager.timeline.input.send(); - textArea.clear(); - event.accepted = true; } } |