From 7b691cc43385d00446b689559352798577920b76 Mon Sep 17 00:00:00 2001 From: Adam Brown Date: Fri, 26 Nov 2021 16:21:57 +0000 Subject: [PATCH] updating comment to mention the cursor position --- .../im/vector/app/features/home/room/detail/AutoCompleter.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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