adobe/brackets — pull request #1625 by peterflynn (2012-09-12 04:43:33+00:00)
Title: Fix Quick Open async bugs

Fix bug #1462 (Typing quickly after first access of Quick Open sends some characters to editor)
and #1579 (Quick Open breaks if you click anywhere before it opens)

The problem was that the Quick Open UI wasn't opened until FileIndexManager had returned a list of files in the project (which might take some async time). In the meantime, typing still went to the editor and clicks crashed (because the Quick Open toolbar is only half-constructed).

The fix is to open the UI immediately, but defer showing results that depend on the file index until it's ready. Smart Autocomplete makes this surprisingly easy since it accepts a Promise in lieu of synchronous results from the search/filter function.

Note that *only* the file search mode (unprefixed search strings) depends on the file index. The other modes still return synchronous results, and actually now feel a bit snappier since they're not forced to wait on a file index they'll never use.