mirror of
https://github.com/Microsoft/vscode
synced 2024-11-05 18:29:38 +00:00
Fix #72208 - stop button on search stops working on long searches
This commit is contained in:
parent
ac6237c706
commit
8aa90d444f
1 changed files with 8 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue