diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/AutoCompleter.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/AutoCompleter.kt index 9c6478725b..7dbd8cc3b5 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/AutoCompleter.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/AutoCompleter.kt @@ -181,7 +181,7 @@ class AutoCompleter @AssistedInject constructor( .with(backgroundDrawable) .with(object : AutocompleteCallback { override fun onPopupItemClicked(editable: Editable, item: String): Boolean { - // Detect last ":" and remove it + // Infer that the last ":" before the current cursor position is the original popup trigger var startIndex = editable.subSequence(0, editText.selectionStart).lastIndexOf(":") if (startIndex == -1) { startIndex = 0