CotEditor icon indicating copy to clipboard operation
CotEditor copied to clipboard

disable that all occurences of current selection are highlighted in same color, too

Open marebe1602 opened this issue 1 year ago • 4 comments

Current issue

when I have a large, non-source-code file and select a fragment e.g. an e-mail address, all other occurences are automatically highlighted in the same selection color, too. In some files this is a problem, because you don't see anymore, which occurence you were actually focusing, on. This is sometimes quite annyoing.

The solution you'd like

use a different color for the automatically highlighted occurences

Alternatives you've considered

add a config parameter to prevent this behaviour

CotEditor version

4.8.5 (653)

macOS version

14.5 Sonoma

Additional context

grafik

marebe1602 avatar Jun 07 '24 13:06 marebe1602

You can disable this feature by turning off the option "highlight instances of selected text" option in the Edit settings pane.

Screenshot 2024-06-09 at 20 57 06

all other occurences are automatically highlighted in the same selection color, too.

Yeah, this point you made is valid. This feature, highlighting all the same instances, was implemented when the macOS system use the specific colors for select text. So I assigned the green color for instance highlight. But in the last systems, macOS prefers using the app specific color for text selection highlight. This new feature is good, in general; however, it now conflicts with the instance highlight. It would be better to change the strategy for such highlighting. Let me think.

1024jp avatar Jun 09 '24 12:06 1024jp

Thanks a lot for your quick answer! I changed my settings now. Depending on the solution I will re-activate the option. I've been using your editor for years and it's great! Keep up the good work.

marebe1602 avatar Jun 10 '24 06:06 marebe1602

Automatically highlight all occurrences of the current selection. This feature is one of the reasons I chose CotEditor over other lightweight editors. It would be great if there was an option to set a different color for these occurrences, as the default system color does not stand out on some themes.

sh2sg avatar Jun 13 '24 17:06 sh2sg

I think now is the right time to add a new color, "Highlight," to the theme format for both occurrences highlighting and matched text highlighting for the Find All command also because Apple added a new highlighting API to TextKit on the upcoming macOS 15. I'll implement it in the next minor update of CotEditor to be released this autumn.

1024jp avatar Jun 14 '24 02:06 1024jp