mirror of
https://github.com/vector-im/element-android.git
synced 2024-11-15 01:35:07 +08:00
Merge pull request #4210 from vector-im/feature/aris/issue_908_user_completion_picket
Feature/aris/issue 908 user completion picket
This commit is contained in:
commit
737a290841
1
changelog.d/908.bugfix
Normal file
1
changelog.d/908.bugfix
Normal file
@ -0,0 +1 @@
|
||||
Issue #908 Adding trailing space " " or ": " if the user started a sentence by mentioning someone,
|
@ -220,8 +220,15 @@ class AutoCompleter @AssistedInject constructor(
|
||||
// Replace the word by its completion
|
||||
val displayName = matrixItem.getBestName()
|
||||
|
||||
// with a trailing space
|
||||
editable.replace(startIndex, endIndex, "$displayName ")
|
||||
// Adding trailing space " " or ": " if the user started mention someone
|
||||
val displayNameSuffix =
|
||||
if (firstChar == "@" && startIndex == 0) {
|
||||
": "
|
||||
} else {
|
||||
" "
|
||||
}
|
||||
|
||||
editable.replace(startIndex, endIndex, "$displayName$displayNameSuffix")
|
||||
|
||||
// Add the span
|
||||
val span = PillImageSpan(
|
||||
|
Loading…
Reference in New Issue
Block a user