From c666cea95c25354242fbe5996674c2ba23b4cb13 Mon Sep 17 00:00:00 2001 From: Kenneth Tam Date: Sun, 16 Feb 2020 09:23:12 +0800 Subject: [PATCH] revert: revert back to original code from szmentionsswift to test on szweier new implementation --- Classes/MentionListener.swift | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Classes/MentionListener.swift b/Classes/MentionListener.swift index 34de1a2..e64afb6 100644 --- a/Classes/MentionListener.swift +++ b/Classes/MentionListener.swift @@ -268,9 +268,7 @@ extension MentionListener /* Private */ { if searchSpaces { let startIndex = mentionsTextView.text.utf16.index(mentionsTextView.text.startIndex, offsetBy: location) let endIndex = mentionsTextView.text.utf16.index(startIndex, offsetBy: NSMaxRange(textView.selectedRange) - location) - if endIndex > startIndex { - mentionString = String(mentionsTextView.text[startIndex ..< endIndex]) - } + mentionString = String(mentionsTextView.text[startIndex ..< endIndex]) } else if let stringBeingTyped = stringToSelectedIndex.components(separatedBy: textBeforeTrigger).last, let stringForMention = stringBeingTyped.components(separatedBy: " ").last, stringForMention.range(of: trigger, options: .anchored) != nil {