diff --git a/src/gui/Pages/Chat/AutoCompletion/UserAutoCompletion.qml b/src/gui/Pages/Chat/AutoCompletion/UserAutoCompletion.qml index 469667a3..0a0e2060 100644 --- a/src/gui/Pages/Chat/AutoCompletion/UserAutoCompletion.qml +++ b/src/gui/Pages/Chat/AutoCompletion/UserAutoCompletion.qml @@ -159,12 +159,13 @@ HListView { const start = root.wordToComplete.start let end = root.wordToComplete.end + 1 - if (currentIndex !== -1) { - const member = model.get(currentIndex) + if (root.currentIndex !== -1) { + const member = root.model.get(root.currentIndex) const repl = member.display_name || member.id end = root.wordToComplete.start + repl.length } + if (pos === root.textArea.length) return if (pos < start || pos > end) root.accept() }