@@ -122,10 +122,7 @@ export class SearchAddon extends Disposable implements ITerminalAddon, ISearchAp
122122 this . _highlightTimeout = setTimeout ( ( ) => {
123123 const term = this . _cachedSearchTerm ;
124124 this . _cachedSearchTerm = undefined ;
125- // Pass noScroll as true for internal incremental update
126- this . _findPreviousAndSelect ( term ! , this . _lastSearchOptions , { noScroll : true } ) ;
127- this . _fireResults ( this . _lastSearchOptions ) ;
128- this . _cachedSearchTerm = term ;
125+ this . findPrevious ( term ! , { ...this . _lastSearchOptions , incremental : true } , { noScroll : true } ) ;
129126 } , 200 ) ;
130127 }
131128 }
@@ -152,7 +149,7 @@ export class SearchAddon extends Disposable implements ITerminalAddon, ISearchAp
152149 * @param searchOptions Search options.
153150 * @returns Whether a result was found.
154151 */
155- public findNext ( term : string , searchOptions ?: ISearchOptions ) : boolean {
152+ public findNext ( term : string , searchOptions ?: ISearchOptions , internalSearchOptions ?: IInternalSearchOptions ) : boolean {
156153 if ( ! this . _terminal ) {
157154 throw new Error ( 'Cannot use addon until it has been loaded' ) ;
158155 }
@@ -164,7 +161,7 @@ export class SearchAddon extends Disposable implements ITerminalAddon, ISearchAp
164161 }
165162 }
166163
167- const found = this . _findNextAndSelect ( term , searchOptions ) ;
164+ const found = this . _findNextAndSelect ( term , searchOptions , internalSearchOptions ) ;
168165 this . _fireResults ( searchOptions ) ;
169166 this . _cachedSearchTerm = term ;
170167
@@ -326,7 +323,7 @@ export class SearchAddon extends Disposable implements ITerminalAddon, ISearchAp
326323 * @param searchOptions Search options.
327324 * @returns Whether a result was found.
328325 */
329- public findPrevious ( term : string , searchOptions ?: ISearchOptions ) : boolean {
326+ public findPrevious ( term : string , searchOptions ?: ISearchOptions , internalSearchOptions ?: IInternalSearchOptions ) : boolean {
330327 if ( ! this . _terminal ) {
331328 throw new Error ( 'Cannot use addon until it has been loaded' ) ;
332329 }
@@ -338,7 +335,7 @@ export class SearchAddon extends Disposable implements ITerminalAddon, ISearchAp
338335 }
339336 }
340337
341- const found = this . _findPreviousAndSelect ( term , searchOptions ) ;
338+ const found = this . _findPreviousAndSelect ( term , searchOptions , internalSearchOptions ) ;
342339 this . _fireResults ( searchOptions ) ;
343340 this . _cachedSearchTerm = term ;
344341
0 commit comments