adobe/brackets — pull request #2662 by peterflynn (2013-01-25 01:13:02+00:00)
Title: Updated: Highlight search feature

_**Do not merge yet**_ -- color choices are pending @GarthDB's review/improvements.

This is an updated version of #2485, using a hack suggested by NJ to give us a bit more flexibility in highlight colors:
* Previously, "current result" color = gray selection color on bottom + "generic result" highlight color blended on top
* Now, "curent result" color = _any_ color we want on bottom + "generic result" highlight color blended on top (this new bg color will never appear "exposed" anywhere -- it's always blended beneath the "generic result" color).

This doesn't give us 100% flexibility -- in particular, the "generic result" color must be transparent and must look good blended atop both the normal editor bg color _and_ atop the "current result" bg color.

I also made a few other changes from the original pull request:
* Remove border from match style since it causes matches that cover multiple code-coloring spans to look like multiple separate matches instead of one
* Beef up unit tests: expect exactly the set of marked ranges, nothing extra; and do a quick & dirty check that DOM has the same number of highlights too
* Lower bailout threshold from ~2MB to 500K (I tested on a 1 MB file and it seemed pretty sluggish).