diff --git a/submodules/Display/Display/SubstringSearch.swift b/submodules/Display/Display/SubstringSearch.swift index 07a4ca2179..f3fecf8e90 100644 --- a/submodules/Display/Display/SubstringSearch.swift +++ b/submodules/Display/Display/SubstringSearch.swift @@ -6,34 +6,50 @@ public func findSubstringRanges(in string: String, query: String) -> ([Range)] = [] + if let index = rawSubstring.firstIndex(of: "'") { + let leftString = String(rawSubstring[.. 0 { - let length = Double(max(word.count, substring.count)) - if length > 0 { - let difference = abs(length - Double(count)) - let rating = difference / length - if rating < 0.33 { - var range = range - if hasLeadingSymbol && range.lowerBound > searchRange.lowerBound { - range = text.index(before: range.lowerBound).. 0 { + let length = Double(max(word.count, substring.count)) + if length > 0 { + let difference = abs(length - Double(count)) + let rating = difference / length + if rating < 0.33 { + var range = range + if hasLeadingSymbol && range.lowerBound > searchRange.lowerBound { + range = text.index(before: range.lowerBound)..