Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/aris/issue 908 user completion picket #4210

Merged
merged 3 commits into from
Oct 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/908.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Issue #908 Adding trailing space " " or ": " if the user started a sentence by mentioning someone,
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down