kean / Pulse

Network logger for Apple platforms

Home Page:https://pulselogger.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Searching removes the backgroundColor of DecodingError highlighted text.

wynioux opened this issue · comments

I have provided screenshots below.

  1. Default

1

  1. Searching part of DecodingError highlighted text

2

  1. As you can see, the backgroundColor has been removed

3

I think this piece of code is causing the bug (it can be found in RichTextViewModel.clearMatches()), but it should be investigated.

textStorage.removeAttribute(.backgroundColor, range: range)

Potential Fix:
We can store the original backgroundColor in RichTextViewModel.SearchMatch and restore the color just like foregroundColor.

By the way I forgot to mention I tested it with code in Main Branch (4.0.0-beta.4) and iOS 16.4.

Good catch.

We can store the original backgroundColor in RichTextViewModel.SearchMatch and restore the color just like foregroundColor.

It seems like an optimal solution.