Skip to content

Commit 6599998

Browse files
authored
Fix microsoft#180856. Enter to replace match (microsoft#181296)
1 parent 11ca8d7 commit 6599998

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFindWidget.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ class NotebookFindWidget extends SimpleFindReplaceWidget implements INotebookEdi
9191
DOM.append(this._notebookEditor.getDomNode(), this.getDomNode());
9292
this._findWidgetFocused = KEYBINDING_CONTEXT_NOTEBOOK_FIND_WIDGET_FOCUSED.bindTo(contextKeyService);
9393
this._register(this._findInput.onKeyDown((e) => this._onFindInputKeyDown(e)));
94+
this._register(this._replaceInput.onKeyDown((e) => this._onReplaceInputKeyDown(e)));
9495

9596
this._register(this._state.onFindReplaceStateChange((e) => {
9697
this.onInputChanged();
@@ -134,6 +135,14 @@ class NotebookFindWidget extends SimpleFindReplaceWidget implements INotebookEdi
134135
}
135136
}
136137

138+
private _onReplaceInputKeyDown(e: IKeyboardEvent): void {
139+
if (e.equals(KeyCode.Enter)) {
140+
this.replaceOne();
141+
e.preventDefault();
142+
return;
143+
}
144+
}
145+
137146
protected onInputChanged(): boolean {
138147
this._state.change({ searchString: this.inputValue }, false);
139148
// this._findModel.research();

0 commit comments

Comments
 (0)