@@ -292,7 +292,7 @@ export abstract class SimpleFindReplaceWidget extends Widget {
292
292
private readonly _innerFindDomNode : HTMLElement ;
293
293
private readonly _focusTracker : dom . IFocusTracker ;
294
294
private readonly _findInputFocusTracker : dom . IFocusTracker ;
295
- private readonly _updateHistoryDelayer : Delayer < void > ;
295
+ private readonly _updateFindHistoryDelayer : Delayer < void > ;
296
296
protected readonly _matchesCount ! : HTMLElement ;
297
297
private readonly prevBtn : SimpleButton ;
298
298
private readonly nextBtn : SimpleButton ;
@@ -301,6 +301,7 @@ export abstract class SimpleFindReplaceWidget extends Widget {
301
301
private readonly _innerReplaceDomNode ! : HTMLElement ;
302
302
private _toggleReplaceBtn ! : SimpleButton ;
303
303
private readonly _replaceInputFocusTracker ! : dom . IFocusTracker ;
304
+ private readonly _updateReplaceHistoryDelayer : Delayer < void > ;
304
305
protected _replaceBtn ! : SimpleButton ;
305
306
protected _replaceAllBtn ! : SimpleButton ;
306
307
@@ -427,12 +428,12 @@ export abstract class SimpleFindReplaceWidget extends Widget {
427
428
) ) ;
428
429
429
430
// Find History with update delayer
430
- this . _updateHistoryDelayer = new Delayer < void > ( 500 ) ;
431
+ this . _updateFindHistoryDelayer = new Delayer < void > ( 500 ) ;
431
432
432
433
this . oninput ( this . _findInput . domNode , ( e ) => {
433
434
this . foundMatch = this . onInputChanged ( ) ;
434
435
this . updateButtons ( this . foundMatch ) ;
435
- this . _delayedUpdateHistory ( ) ;
436
+ this . _delayedUpdateFindHistory ( ) ;
436
437
} ) ;
437
438
438
439
this . _register ( this . _findInput . inputBox . onDidChange ( ( ) => {
@@ -585,6 +586,13 @@ export abstract class SimpleFindReplaceWidget extends Widget {
585
586
this . _register ( this . _replaceInputFocusTracker . onDidFocus ( this . onReplaceInputFocusTrackerFocus . bind ( this ) ) ) ;
586
587
this . _register ( this . _replaceInputFocusTracker . onDidBlur ( this . onReplaceInputFocusTrackerBlur . bind ( this ) ) ) ;
587
588
589
+ // Replace History with update delayer
590
+ this . _updateReplaceHistoryDelayer = new Delayer < void > ( 500 ) ;
591
+
592
+ this . oninput ( this . _replaceInput . domNode , ( e ) => {
593
+ this . _delayedUpdateReplaceHistory ( ) ;
594
+ } ) ;
595
+
588
596
this . _register ( this . _replaceInput . inputBox . onDidChange ( ( ) => {
589
597
this . _state . change ( { replaceString : this . _replaceInput . getValue ( ) } , true ) ;
590
598
} ) ) ;
@@ -875,14 +883,22 @@ export abstract class SimpleFindReplaceWidget extends Widget {
875
883
}
876
884
}
877
885
878
- protected _delayedUpdateHistory ( ) {
879
- this . _updateHistoryDelayer . trigger ( this . _updateHistory . bind ( this ) ) ;
886
+ protected _delayedUpdateFindHistory ( ) {
887
+ this . _updateFindHistoryDelayer . trigger ( this . _updateFindHistory . bind ( this ) ) ;
880
888
}
881
889
882
- protected _updateHistory ( ) {
890
+ protected _updateFindHistory ( ) {
883
891
this . _findInput . inputBox . addToHistory ( ) ;
884
892
}
885
893
894
+ protected _delayedUpdateReplaceHistory ( ) {
895
+ this . _updateReplaceHistoryDelayer . trigger ( this . _updateReplaceHistory . bind ( this ) ) ;
896
+ }
897
+
898
+ protected _updateReplaceHistory ( ) {
899
+ this . _replaceInput . inputBox . addToHistory ( ) ;
900
+ }
901
+
886
902
protected _getRegexValue ( ) : boolean {
887
903
return this . _findInput . getRegex ( ) ;
888
904
}
0 commit comments