mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-19 04:53:36 +00:00
[core] Only include branch in search highlight range on iOS
Can be removed when other platforms incorporate branch in UI Signed-off-by: eisa01 <eisa01@gmail.com>
This commit is contained in:
@@ -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<uint16_t, uint16_t> const & range) { res.AddHighlightRange(range); });
|
||||
|
||||
Reference in New Issue
Block a user