From a24348b57442820473c308f4bbefbdc7b66557b4 Mon Sep 17 00:00:00 2001
From: Thomas Karpiniec <tk@1.21jiggawatts.net>
Date: Sat, 21 Aug 2021 13:31:27 +1000
Subject: [PATCH] Allow opening a completer starting with selected text

---
 resources/qml/MessageInput.qml | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/resources/qml/MessageInput.qml b/resources/qml/MessageInput.qml
index fab5a375c..401d4d853 100644
--- a/resources/qml/MessageInput.qml
+++ b/resources/qml/MessageInput.qml
@@ -165,13 +165,13 @@ Rectangle {
                     } else if (event.modifiers == Qt.ControlModifier && event.key == Qt.Key_N) {
                         messageInput.text = room.input.nextText();
                     } else if (event.key == Qt.Key_At) {
-                        messageInput.openCompleter(cursorPosition, "user");
+                        messageInput.openCompleter(selectionStart, "user");
                         popup.open();
                     } else if (event.key == Qt.Key_Colon) {
-                        messageInput.openCompleter(cursorPosition, "emoji");
+                        messageInput.openCompleter(selectionStart, "emoji");
                         popup.open();
                     } else if (event.key == Qt.Key_NumberSign) {
-                        messageInput.openCompleter(cursorPosition, "roomAliases");
+                        messageInput.openCompleter(selectionStart, "roomAliases");
                         popup.open();
                     } else if (event.key == Qt.Key_Escape && popup.opened) {
                         completerTriggeredAt = -1;
-- 
GitLab