mirror of
https://github.com/oxen-io/session-ios.git
synced 2023-12-13 21:30:14 +01:00
Fix mentions + search bug
This commit is contained in:
parent
8470e1b265
commit
58fbd16286
|
@ -716,7 +716,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
NSRegularExpression *regex = [[NSRegularExpression alloc] initWithPattern:[NSRegularExpression escapedPatternForString:searchableText] options:NSRegularExpressionCaseInsensitive error:&error];
|
||||
OWSAssertDebug(error == nil);
|
||||
for (NSTextCheckingResult *match in
|
||||
[regex matchesInString:text options:NSMatchingWithoutAnchoringBounds range:NSMakeRange(0, text.length)]) {
|
||||
[regex matchesInString:attributedText.string options:NSMatchingWithoutAnchoringBounds range:NSMakeRange(0, attributedText.string.length)]) {
|
||||
OWSAssertDebug(match.range.length >= ConversationSearchController.kMinimumSearchTextLength);
|
||||
UIColor *highlightColor;
|
||||
if (LKAppModeUtilities.isLightMode) {
|
||||
|
@ -724,6 +724,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
} else {
|
||||
highlightColor = UIColor.whiteColor;
|
||||
}
|
||||
if (match.range.location + match.range.length > attributedText.length) { continue; }
|
||||
[attributedText addAttribute:NSBackgroundColorAttributeName value:highlightColor range:match.range];
|
||||
[attributedText addAttribute:NSForegroundColorAttributeName value:UIColor.blackColor range:match.range];
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue