mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
fix: Make search escape regex, so '.' and similar behave properly. (#2263)
This commit is contained in:
parent
55a2bda513
commit
ea25a8198a
2 changed files with 7 additions and 5 deletions
|
|
@ -297,7 +297,7 @@ private fun rememberAnnotatedString(
|
|||
append(text)
|
||||
if (searchText.isNotEmpty()) {
|
||||
searchText.split(" ").forEach { term ->
|
||||
term.toRegex(RegexOption.IGNORE_CASE).findAll(text).forEach { match ->
|
||||
Regex(Regex.escape(term), RegexOption.IGNORE_CASE).findAll(text).forEach { match ->
|
||||
addStyle(
|
||||
style = highlightStyle,
|
||||
start = match.range.first,
|
||||
|
|
@ -339,7 +339,7 @@ private fun rememberAnnotatedLogMessage(log: UiMeshLog, searchText: String): Ann
|
|||
// Add search highlight annotations
|
||||
if (searchText.isNotEmpty()) {
|
||||
searchText.split(" ").forEach { term ->
|
||||
term.toRegex(RegexOption.IGNORE_CASE).findAll(log.logMessage).forEach { match ->
|
||||
Regex(Regex.escape(term), RegexOption.IGNORE_CASE).findAll(log.logMessage).forEach { match ->
|
||||
addStyle(
|
||||
style = highlightStyle,
|
||||
start = match.range.first,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue