             self.delegate?.textViewDidChangeSelection?(textView)
         }
     }
-
+    
     open func textViewDidEndEditing(_ textView: UITextView) {
         self.delegate?.textViewDidEndEditing?(textView)
     }
-
+    
     open func textViewShouldBeginEditing(_ textView: UITextView) -> Bool {
         if let shouldBeginEditing = self.delegate?.textViewShouldBeginEditing?(textView) {
             return shouldBeginEditing

    fileprivate func adjust(_ textView: UITextView, range: NSRange) {
        let substring = (textView.text as NSString).substring(to: range.location) as NSString

      
        var textBeforeTrigger = " "
        let location = substring.range(
            of: trigger as String,

        _ textView: UITextView,
        shouldChangeTextIn range: NSRange,
        replacementText text: String) -> Bool {
        assert((textView.delegate?.isEqual(self))!,
               "Textview delegate must be set equal to SZMentionsListener")

        if text == "\n" && self.addMentionAfterReturnKey && self.mentionEnabled {
            self.mentionsManager.shouldAddMentionOnReturnKey?()
            self.mentionEnabled = false
            self.mentionsManager.hideMentionsList()

            return false
        }
        let _ = self.delegate?.textView?(
            textView,
            shouldChangeTextIn: range,
            replacementText: text)

        if (self.settingText == true) {
            return false
        }
