@@ -281,7 +281,8 @@ export class SearchWidget extends Widget {
281281 appendCaseSensitiveLabel : appendKeyBindingLabel ( '' , this . keyBindingService . lookupKeybinding ( Constants . ToggleCaseSensitiveCommandId ) , this . keyBindingService ) ,
282282 appendWholeWordsLabel : appendKeyBindingLabel ( '' , this . keyBindingService . lookupKeybinding ( Constants . ToggleWholeWordCommandId ) , this . keyBindingService ) ,
283283 appendRegexLabel : appendKeyBindingLabel ( '' , this . keyBindingService . lookupKeybinding ( Constants . ToggleRegexCommandId ) , this . keyBindingService ) ,
284- history : options . searchHistory
284+ history : options . searchHistory ,
285+ flexibleHeight : true
285286 } ;
286287
287288 let searchInputContainer = dom . append ( parent , dom . $ ( '.search-container.input-box' ) ) ;
@@ -329,7 +330,8 @@ export class SearchWidget extends Widget {
329330 this . replaceInput = this . _register ( new ContextScopedHistoryInputBox ( replaceBox , this . contextViewService , {
330331 ariaLabel : nls . localize ( 'label.Replace' , 'Replace: Type replace term and press Enter to preview or Escape to cancel' ) ,
331332 placeholder : nls . localize ( 'search.replace.placeHolder' , "Replace" ) ,
332- history : options . replaceHistory || [ ]
333+ history : options . replaceHistory || [ ] ,
334+ flexibleHeight : true
333335 } , this . contextKeyService ) ) ;
334336 this . _register ( attachInputBoxStyler ( this . replaceInput , this . themeService ) ) ;
335337 this . onkeydown ( this . replaceInput . inputElement , ( keyboardEvent ) => this . onReplaceInputKeyDown ( keyboardEvent ) ) ;
@@ -376,6 +378,7 @@ export class SearchWidget extends Widget {
376378 if ( currentState !== newState ) {
377379 this . replaceActive . set ( newState ) ;
378380 this . _onReplaceStateChange . fire ( newState ) ;
381+ this . replaceInput . layout ( ) ;
379382 }
380383 }
381384
@@ -429,6 +432,20 @@ export class SearchWidget extends Widget {
429432 }
430433 keyboardEvent . preventDefault ( ) ;
431434 }
435+
436+ else if ( keyboardEvent . equals ( KeyCode . UpArrow ) ) {
437+ const ta = this . searchInput . domNode . querySelector ( 'textarea' ) ;
438+ if ( ta && ta . selectionStart > 0 ) {
439+ keyboardEvent . stopPropagation ( ) ;
440+ }
441+ }
442+
443+ else if ( keyboardEvent . equals ( KeyCode . DownArrow ) ) {
444+ const ta = this . searchInput . domNode . querySelector ( 'textarea' ) ;
445+ if ( ta && ta . selectionEnd < ta . value . length ) {
446+ keyboardEvent . stopPropagation ( ) ;
447+ }
448+ }
432449 }
433450
434451 private onCaseSensitiveKeyDown ( keyboardEvent : IKeyboardEvent ) {
@@ -466,6 +483,20 @@ export class SearchWidget extends Widget {
466483 this . searchInput . focus ( ) ;
467484 keyboardEvent . preventDefault ( ) ;
468485 }
486+
487+ else if ( keyboardEvent . equals ( KeyCode . UpArrow ) ) {
488+ const ta = this . searchInput . domNode . querySelector ( 'textarea' ) ;
489+ if ( ta && ta . selectionStart > 0 ) {
490+ keyboardEvent . stopPropagation ( ) ;
491+ }
492+ }
493+
494+ else if ( keyboardEvent . equals ( KeyCode . DownArrow ) ) {
495+ const ta = this . searchInput . domNode . querySelector ( 'textarea' ) ;
496+ if ( ta && ta . selectionEnd < ta . value . length ) {
497+ keyboardEvent . stopPropagation ( ) ;
498+ }
499+ }
469500 }
470501
471502 private onReplaceActionbarKeyDown ( keyboardEvent : IKeyboardEvent ) {
0 commit comments