@@ -67,6 +67,7 @@ let FIND_ALL_CONTROLS_WIDTH = 17/** Find Input margin-left */ + (MAX_MATCHES_COU
67
67
const FIND_INPUT_AREA_HEIGHT = 33 ; // The height of Find Widget when Replace Input is not visible.
68
68
const ctrlEnterReplaceAllWarningPromptedKey = 'ctrlEnterReplaceAll.windows.donotask' ;
69
69
70
+ const ctrlKeyMod = ( platform . isMacintosh ? KeyMod . WinCtrl : KeyMod . CtrlCmd ) ;
70
71
export class FindWidgetViewZone implements IViewZone {
71
72
public readonly afterLineNumber : number ;
72
73
public heightInPx : number ;
@@ -775,7 +776,7 @@ export class FindWidget extends Widget implements IOverlayWidget, IHorizontalSas
775
776
}
776
777
777
778
private _onFindInputKeyDown ( e : IKeyboardEvent ) : void {
778
- if ( e . equals ( KeyMod . WinCtrl | KeyCode . Enter ) ) {
779
+ if ( e . equals ( ctrlKeyMod | KeyCode . Enter ) ) {
779
780
const inputElement = this . _findInput . inputBox . inputElement ;
780
781
const start = inputElement . selectionStart ;
781
782
const end = inputElement . selectionEnd ;
@@ -817,7 +818,7 @@ export class FindWidget extends Widget implements IOverlayWidget, IHorizontalSas
817
818
}
818
819
819
820
private _onReplaceInputKeyDown ( e : IKeyboardEvent ) : void {
820
- if ( e . equals ( KeyMod . WinCtrl | KeyCode . Enter ) ) {
821
+ if ( e . equals ( ctrlKeyMod | KeyCode . Enter ) ) {
821
822
if ( platform . isWindows && platform . isNative && ! this . _ctrlEnterReplaceAllWarningPrompted ) {
822
823
// this is the first time when users press Ctrl + Enter to replace all
823
824
this . _notificationService . info (
@@ -835,7 +836,7 @@ export class FindWidget extends Widget implements IOverlayWidget, IHorizontalSas
835
836
const end = inputElement . selectionEnd ;
836
837
const content = inputElement . value ;
837
838
838
- if ( start && end ) {
839
+ if ( start !== null && end !== null ) {
839
840
const value = content . substr ( 0 , start ) + '\n' + content . substr ( end ) ;
840
841
this . _replaceInput . inputBox . value = value ;
841
842
inputElement . setSelectionRange ( start + 1 , start + 1 ) ;
0 commit comments