提交 1b7c6736 编写于 作者: R Rob Lourens

Fix #64331 - relayout on search height change

上级 416e6c51
......@@ -330,7 +330,9 @@ export class SearchView extends Viewlet implements IViewlet, IPanel {
this._register(this.searchWidget.onSearchCancel(() => this.cancelSearch()));
this._register(this.searchWidget.searchInput.onDidOptionChange(() => this.onQueryChanged(true)));
this._register(this.searchWidget.onReplaceToggled(() => this.onReplaceToggled()));
this._register(this.searchWidget.onDidHeightChange(() => this.reLayout()));
this._register(this.searchWidget.onReplaceToggled(() => this.reLayout()));
this._register(this.searchWidget.onReplaceStateChange((state) => {
this.viewModel.replaceActive = state;
this.tree.refresh();
......@@ -367,10 +369,6 @@ export class SearchView extends Viewlet implements IViewlet, IPanel {
}));
}
private onReplaceToggled(): void {
this.layout(this.size);
}
private onSearchResultsChanged(event?: IChangeEvent): Thenable<any> {
if (this.isVisible()) {
return this.refreshAndUpdateCount(event);
......
......@@ -123,6 +123,9 @@ export class SearchWidget extends Widget {
private _onBlur = this._register(new Emitter<void>());
public readonly onBlur: Event<void> = this._onBlur.event;
private _onDidHeightChange = this._register(new Emitter<void>());
public readonly onDidHeightChange: Event<void> = this._onDidHeightChange.event;
constructor(
container: HTMLElement,
options: ISearchWidgetOptions,
......@@ -298,8 +301,10 @@ export class SearchWidget extends Widget {
this._register(this.onSearchSubmit(() => {
this.searchInput.inputBox.addToHistory();
}));
this.searchInput.onCaseSensitiveKeyDown((keyboardEvent: IKeyboardEvent) => this.onCaseSensitiveKeyDown(keyboardEvent));
this.searchInput.onRegexKeyDown((keyboardEvent: IKeyboardEvent) => this.onRegexKeyDown(keyboardEvent));
this._register(this.searchInput.onCaseSensitiveKeyDown((keyboardEvent: IKeyboardEvent) => this.onCaseSensitiveKeyDown(keyboardEvent)));
this._register(this.searchInput.onRegexKeyDown((keyboardEvent: IKeyboardEvent) => this.onRegexKeyDown(keyboardEvent)));
this._register(this.searchInput.inputBox.onDidChange(() => this.onSearchInputChanged()));
this._register(this.searchInput.inputBox.onDidHeightChange(() => this._onDidHeightChange.fire()));
this._register(this.onReplaceValueChanged(() => {
this._replaceHistoryDelayer.trigger(() => this.replaceInput.addToHistory());
......@@ -338,8 +343,8 @@ export class SearchWidget extends Widget {
this._register(attachInputBoxStyler(this.replaceInput, this.themeService));
this.onkeydown(this.replaceInput.inputElement, (keyboardEvent) => this.onReplaceInputKeyDown(keyboardEvent));
this.replaceInput.value = options.replaceValue || '';
this.replaceInput.onDidChange(() => this._onReplaceValueChanged.fire());
this.searchInput.inputBox.onDidChange(() => this.onSearchInputChanged());
this._register(this.replaceInput.onDidChange(() => this._onReplaceValueChanged.fire()));
this._register(this.replaceInput.onDidHeightChange(() => this._onDidHeightChange.fire()));
this.replaceAllAction = ReplaceAllAction.INSTANCE;
this.replaceAllAction.searchWidget = this;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册