Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Commit

Permalink
Fixes #2608 (QuickOpen shows red on first use) and also makes QuickOp…
Browse files Browse the repository at this point in the history
…en more responsive on

large projects by not immediately invalidating the cached file list.
  • Loading branch information
dangoor committed Mar 20, 2013
1 parent 2ad7c7b commit e423527
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/search/QuickOpen.js
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ define(function (require, exports, module) {
*/
QuickNavigateDialog.prototype._handleResultsReady = function (e, results) {
// Give visual clue when there are no results
var isNoResults = (results.length === 0 && !this._isValidLineNumberQuery(this.$searchField.val()));
var isNoResults = (results.length === 0 && fileList && !this._isValidLineNumberQuery(this.$searchField.val()));
this.$searchField.toggleClass("no-results", isNoResults);
};

Expand Down Expand Up @@ -786,7 +786,6 @@ define(function (require, exports, module) {

// Start fetching the file list, which will be needed the first time the user enters an un-prefixed query. If FileIndexManager's
// caches are out of date, this list might take some time to asynchronously build. See searchFileList() for how this is handled.
fileList = null;
fileListPromise = FileIndexManager.getFileInfoList("all")
.done(function (files) {
fileList = files;
Expand Down Expand Up @@ -833,8 +832,11 @@ define(function (require, exports, module) {
beginSearch("@", getCurrentEditorSelectedText());
}
}



// Listen for a change of project to invalidate our file list
$(ProjectManager).on("projectOpen", function () {
fileList = null;
});

// TODO: allow QuickOpenJS to register it's own commands and key bindings
CommandManager.register(Strings.CMD_QUICK_OPEN, Commands.NAVIGATE_QUICK_OPEN, doFileSearch);
Expand Down

0 comments on commit e423527

Please sign in to comment.