adobe/brackets — pull request #8566 by peterflynn (2014-07-25 23:15:08+00:00)
Title: Fix bug #8556 (Find/Replace in Files with /^/ finds 100K matches at start of file)

Fix bug #8556 -- `/^/` is a pathological regexp that returns 0-length matches, so `FindInFiles._getSearchMatches()` was going into an infinite loop (saved from freezing only by the 100K match limit).

This fixes Find/Replace in Files to return the correct results: an insertion point at the start of every line in the file.

Single-file Find/Replace is inconsistent with this because it uses CM searchcursor instead of `_getSearchMatches()`. That code already avoids an infinite loop, but it does it in a way where the result set is slightly different (the 1st char of every non-empty line). Trello card https://trello.com/c/yho8jb7y is probably a good spot down the road to clean up all such inconsistencies in one batch.

Adds unit tests for both multi-file & single-file cases (also corrects an older FindReplace regexp test that was broken).