Skip to content

Commit 96b160d

Browse files
committed
1 parent 7fdc489 commit 96b160d

File tree

1 file changed

+24
-14
lines changed

1 file changed

+24
-14
lines changed

src/vs/editor/contrib/find/findWidget.ts

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -852,9 +852,14 @@ export class FindWidget extends Widget implements IOverlayWidget, IVerticalSashL
852852

853853
private _onFindInputKeyDown(e: IKeyboardEvent): void {
854854
if (e.equals(ctrlKeyMod | KeyCode.Enter)) {
855-
this._findInput.inputBox.insertAtCursor('\n');
856-
e.preventDefault();
857-
return;
855+
if (this._keybindingService.dispatchEvent(e, e.target)) {
856+
e.preventDefault();
857+
return;
858+
} else {
859+
this._findInput.inputBox.insertAtCursor('\n');
860+
e.preventDefault();
861+
return;
862+
}
858863
}
859864

860865
if (e.equals(KeyCode.Tab)) {
@@ -884,21 +889,26 @@ export class FindWidget extends Widget implements IOverlayWidget, IVerticalSashL
884889

885890
private _onReplaceInputKeyDown(e: IKeyboardEvent): void {
886891
if (e.equals(ctrlKeyMod | KeyCode.Enter)) {
887-
if (platform.isWindows && platform.isNative && !this._ctrlEnterReplaceAllWarningPrompted) {
888-
// this is the first time when users press Ctrl + Enter to replace all
889-
this._notificationService.info(
890-
nls.localize('ctrlEnter.keybindingChanged',
891-
'Ctrl+Enter now inserts line break instead of replacing all. You can modify the keybinding for editor.action.replaceAll to override this behavior.')
892-
);
892+
if (this._keybindingService.dispatchEvent(e, e.target)) {
893+
e.preventDefault();
894+
return;
895+
} else {
896+
if (platform.isWindows && platform.isNative && !this._ctrlEnterReplaceAllWarningPrompted) {
897+
// this is the first time when users press Ctrl + Enter to replace all
898+
this._notificationService.info(
899+
nls.localize('ctrlEnter.keybindingChanged',
900+
'Ctrl+Enter now inserts line break instead of replacing all. You can modify the keybinding for editor.action.replaceAll to override this behavior.')
901+
);
893902

894-
this._ctrlEnterReplaceAllWarningPrompted = true;
895-
this._storageService.store(ctrlEnterReplaceAllWarningPromptedKey, true, StorageScope.GLOBAL, StorageTarget.USER);
903+
this._ctrlEnterReplaceAllWarningPrompted = true;
904+
this._storageService.store(ctrlEnterReplaceAllWarningPromptedKey, true, StorageScope.GLOBAL, StorageTarget.USER);
905+
}
896906

907+
this._replaceInput.inputBox.insertAtCursor('\n');
908+
e.preventDefault();
909+
return;
897910
}
898911

899-
this._replaceInput.inputBox.insertAtCursor('\n');
900-
e.preventDefault();
901-
return;
902912
}
903913

904914
if (e.equals(KeyCode.Tab)) {

0 commit comments

Comments
 (0)