From 7afb1df917f1e78de754a86760497fe8080a0b01 Mon Sep 17 00:00:00 2001 From: eisa01 Date: Thu, 23 Oct 2025 16:39:50 +0200 Subject: [PATCH] [core] Only include branch in search highlight range on iOS Can be removed when other platforms incorporate branch in UI Signed-off-by: eisa01 --- libs/search/highlighting.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libs/search/highlighting.cpp b/libs/search/highlighting.cpp index e8a3a85d7..3bed5d87d 100644 --- a/libs/search/highlighting.cpp +++ b/libs/search/highlighting.cpp @@ -1,4 +1,5 @@ #include "search/highlighting.hpp" +#include "std/target_os.hpp" namespace search { @@ -51,12 +52,11 @@ void HighlightResult(QueryTokens const & tokens, strings::UniString const & pref std::string titleForHighlighting = res.GetString(); std::string const & branch = res.GetBranch(); - // If we have a branch that is not already in the title, create combined string for highlighting - // This matches the iOS UI behavior where branch is appended as " branchText" + // On iOS we append branch text to the title for highlighting if it's not already present. +#if defined(OMIM_OS_IPHONE) if (!branch.empty() && titleForHighlighting.find(branch) == std::string::npos) - { titleForHighlighting += " " + branch; - } +#endif SearchStringTokensIntersectionRanges( titleForHighlighting, beg, end, [&](std::pair const & range) { res.AddHighlightRange(range); });