mirror of
https://github.com/element-hq/element-android
synced 2024-11-24 02:15:35 +03: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
2 changed files with 10 additions and 2 deletions
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 a new issue