@@ -400,9 +400,10 @@ define(function (require, exports, module) {
400400 * list items are re-rendered. Both happen synchronously just after we return. Called even when results is empty.
401401 */
402402 QuickNavigateDialog . prototype . _handleResultsReady = function ( e , results ) {
403- // Give visual clue when there are no results
404- var isNoResults = ( results . length === 0 && ! this . _isValidLineNumberQuery ( this . $searchField . val ( ) ) ) ;
405- this . $searchField . toggleClass ( "no-results" , isNoResults ) ;
403+ // Give visual clue when there are no results (unless we're in "Go To Line" mode, where there
404+ // are never results, or we're in file search mode and waiting for the index to get rebuilt)
405+ var isNoResults = ( results . length === 0 && ( fileList || currentPlugin ) && ! this . _isValidLineNumberQuery ( this . $searchField . val ( ) ) ) ;
406+ this . $searchField . toggleClass ( "no-results" , Boolean ( isNoResults ) ) ;
406407 } ;
407408
408409 /**
@@ -787,12 +788,12 @@ define(function (require, exports, module) {
787788
788789 // Start fetching the file list, which will be needed the first time the user enters an un-prefixed query. If FileIndexManager's
789790 // caches are out of date, this list might take some time to asynchronously build. See searchFileList() for how this is handled.
790- fileList = null ;
791791 fileListPromise = FileIndexManager . getFileInfoList ( "all" )
792792 . done ( function ( files ) {
793793 fileList = files ;
794794 fileListPromise = null ;
795- } ) ;
795+ this . _filenameMatcher . reset ( ) ;
796+ } . bind ( this ) ) ;
796797 } ;
797798
798799 function getCurrentEditorSelectedText ( ) {
@@ -834,8 +835,11 @@ define(function (require, exports, module) {
834835 beginSearch ( "@" , getCurrentEditorSelectedText ( ) ) ;
835836 }
836837 }
837-
838-
838+
839+ // Listen for a change of project to invalidate our file list
840+ $ ( ProjectManager ) . on ( "projectOpen" , function ( ) {
841+ fileList = null ;
842+ } ) ;
839843
840844 // TODO: allow QuickOpenJS to register it's own commands and key bindings
841845 CommandManager . register ( Strings . CMD_QUICK_OPEN , Commands . NAVIGATE_QUICK_OPEN , doFileSearch ) ;
0 commit comments