QUESTION
What is the best way of displaying highlighted text in a text editor?
I know of shading, which simulates what a physical highlighter does:

And 'xor' highlighting:

Are there any other methods? Which method is preferable?
ANSWER
If you can, you should leave it up to the user's operating system settings. OS X does a highlight effect by default, while the linux machine I'm on now (as well as Windows, if I remember right) does a bluish XOR.
As a user, it would definitely look strange to me if I was accustomed to my blue XOR effect and some application displayed a highlight effect (or vice versa). It would throw me off a second. Sure, I could figure out what was going on, but it's a visual anomaly with the rest of the system that could easily be avoided by either not overriding the effect, or inheriting from the system (if you must specify in a lower language).
Tweet