Merge from vscode cfbd1999769f4f08dce29629fb92fdc0fac53829

This commit is contained in:
ADS Merger
2020-08-06 07:08:52 +00:00
parent 9c67832880
commit 540046ba00
362 changed files with 7588 additions and 6584 deletions

View File

@@ -43,7 +43,7 @@ export abstract class SimpleFindReplaceWidget extends Widget {
private readonly prevBtn: SimpleButton;
private readonly nextBtn: SimpleButton;
private readonly _replaceInput!: ReplaceInput;
protected readonly _replaceInput!: ReplaceInput;
private readonly _innerReplaceDomNode!: HTMLElement;
private _toggleReplaceBtn!: SimpleButton;
private readonly _replaceInputFocusTracker!: dom.IFocusTracker;
@@ -372,6 +372,34 @@ export abstract class SimpleFindReplaceWidget extends Widget {
}, 0);
}
public showWithReplace(initialInput?: string, replaceInput?: string): void {
if (initialInput && !this._isVisible) {
this._findInput.setValue(initialInput);
}
if (replaceInput && !this._isVisible) {
this._replaceInput.setValue(replaceInput);
}
this._isVisible = true;
this._isReplaceVisible = true;
this._state.change({ isReplaceRevealed: this._isReplaceVisible }, false);
if (this._isReplaceVisible) {
this._innerReplaceDomNode.style.display = 'flex';
} else {
this._innerReplaceDomNode.style.display = 'none';
}
setTimeout(() => {
dom.addClass(this._domNode, 'visible');
dom.addClass(this._domNode, 'visible-transition');
this._domNode.setAttribute('aria-hidden', 'false');
this._updateButtons();
this._replaceInput.focus();
}, 0);
}
public hide(): void {
if (this._isVisible) {
dom.removeClass(this._domNode, 'visible-transition');