@@ -132,12 +132,11 @@ function setPadding(): void {
132132 addons . fit . instance . fit ( ) ;
133133}
134134
135- function getSearchOptions ( e : KeyboardEvent ) : ISearchOptions {
135+ function getSearchOptions ( ) : ISearchOptions {
136136 return {
137137 regex : ( document . getElementById ( 'regex' ) as HTMLInputElement ) . checked ,
138138 wholeWord : ( document . getElementById ( 'whole-word' ) as HTMLInputElement ) . checked ,
139139 caseSensitive : ( document . getElementById ( 'case-sensitive' ) as HTMLInputElement ) . checked ,
140- incremental : e . key !== `Enter` ,
141140 decorations : ( document . getElementById ( 'highlight-all-matches' ) as HTMLInputElement ) . checked ? {
142141 matchBackground : '#232422' ,
143142 matchBorder : '#555753' ,
@@ -303,11 +302,23 @@ function createTerminal(): void {
303302
304303 addDomListener ( paddingElement , 'change' , setPadding ) ;
305304
306- addDomListener ( actionElements . findNext , 'keyup' , ( e ) => {
307- addons . search . instance . findNext ( actionElements . findNext . value , getSearchOptions ( e ) ) ;
305+ addDomListener ( actionElements . findNext , 'keydown' , ( e ) => {
306+ if ( e . key === 'Enter' ) {
307+ addons . search . instance . findNext ( actionElements . findNext . value , getSearchOptions ( ) ) ;
308+ e . preventDefault ( ) ;
309+ }
310+ } ) ;
311+ addDomListener ( actionElements . findNext , 'input' , ( e ) => {
312+ addons . search . instance . findNext ( actionElements . findNext . value , getSearchOptions ( ) ) ;
313+ } ) ;
314+ addDomListener ( actionElements . findPrevious , 'keydown' , ( e ) => {
315+ if ( e . key === 'Enter' ) {
316+ addons . search . instance . findPrevious ( actionElements . findPrevious . value , getSearchOptions ( ) ) ;
317+ e . preventDefault ( ) ;
318+ }
308319 } ) ;
309- addDomListener ( actionElements . findPrevious , 'keyup ' , ( e ) => {
310- addons . search . instance . findPrevious ( actionElements . findPrevious . value , getSearchOptions ( e ) ) ;
320+ addDomListener ( actionElements . findPrevious , 'input ' , ( e ) => {
321+ addons . search . instance . findPrevious ( actionElements . findPrevious . value , getSearchOptions ( ) ) ;
311322 } ) ;
312323 addDomListener ( actionElements . findNext , 'blur' , ( e ) => {
313324 addons . search . instance . clearActiveDecoration ( ) ;
0 commit comments