Fix #72208 - stop button on search stops working on long searches

This commit is contained in:
Rob Lourens 2019-05-22 17:50:58 -07:00
parent ac6237c706
commit 8aa90d444f

View file

@ -342,6 +342,9 @@ export class SearchView extends ViewletPanel {
return this.inputPatternExcludes;
}
/**
* Warning: a bit expensive due to updating the view title
*/
protected updateActions(): void {
for (const action of this.actions) {
action.update();
@ -1386,6 +1389,8 @@ export class SearchView extends ViewletPanel {
let visibleMatches = 0;
let updatedActionsForFileCount = false;
// Handle UI updates in an interval to show frequent progress and results
const uiRefreshHandle: any = setInterval(() => {
if (!this.searching) {
@ -1399,7 +1404,9 @@ export class SearchView extends ViewletPanel {
visibleMatches = fileCount;
this.refreshAndUpdateCount();
}
if (fileCount > 0) {
if (fileCount > 0 && !updatedActionsForFileCount) {
updatedActionsForFileCount = true;
this.updateActions();
}
}, 100);