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

Commit

Permalink
fixes 3 failing find-in-files tests (#12973)
Browse files Browse the repository at this point in the history
* fixes 3 failing find-in-files tests

* implement proposed change
  • Loading branch information
zaggino authored and ficristo committed Dec 13, 2016
1 parent f7d4e35 commit 1936493
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/search/SearchModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ define(function (require, exports, module) {
* Clears out the model to an empty state.
*/
SearchModel.prototype.clear = function () {
var numMatchesBefore = this.numMatches;
this.results = {};
this.queryInfo = null;
this.queryExpr = null;
Expand All @@ -120,7 +121,9 @@ define(function (require, exports, module) {
this.numMatches = 0;
this.foundMaximum = false;
this.exceedsMaximum = false;
this.fireChanged();
if (numMatchesBefore !== 0) {
this.fireChanged();
}
};

/**
Expand Down
2 changes: 2 additions & 0 deletions test/spec/FindInFiles-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -785,6 +785,8 @@ define(function (require, exports, module) {
gotChange = false;
oldResults = null;
wasQuickChange = false;

FindInFiles.clearSearch(); // calls FindInFiles.searchModel.clear internally
FindInFiles.searchModel.on("change.FindInFilesTest", function (event, quickChange) {
gotChange = true;
wasQuickChange = quickChange;
Expand Down

0 comments on commit 1936493

Please sign in to comment.