diff options
Diffstat (limited to 'ui')
-rw-r--r-- | ui/room-view.go | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/ui/room-view.go b/ui/room-view.go index 332605b..a66b0ee 100644 --- a/ui/room-view.go +++ b/ui/room-view.go @@ -242,10 +242,7 @@ type completion struct { } func (view *RoomView) AutocompleteUser(existingText string) (completions []completion) { - textWithoutPrefix := existingText - if strings.HasPrefix(existingText, "@") { - textWithoutPrefix = existingText[1:] - } + textWithoutPrefix := strings.TrimPrefix(existingText, "@") for _, user := range view.Room.GetMembers() { if user.DisplayName == textWithoutPrefix || user.UserID == existingText { // Exact match, return that. |