diff --git a/src/addons/search/SearchHelper.ts b/src/addons/search/SearchHelper.ts index 0ee5ad12..207e566b 100644 --- a/src/addons/search/SearchHelper.ts +++ b/src/addons/search/SearchHelper.ts @@ -113,7 +113,8 @@ export class SearchHelper implements ISearchHelper { if (this._terminal._core.buffer.lines.get(y).isWrapped) { return; } - const lowerStringLine = this.translateBufferLineToStringWithWrap(y, true).toLowerCase(); const lowerTerm = term.toLowerCase(); + const lowerStringLine = this.translateBufferLineToStringWithWrap(y, true).toLowerCase(); + const lowerTerm = term.toLowerCase(); let searchIndex = -1; if (searchOptions.regex) { const searchRegex = RegExp(lowerTerm, 'g'); diff --git a/src/addons/search/search.test.ts b/src/addons/search/search.test.ts index 2e0778e0..74796930 100644 --- a/src/addons/search/search.test.ts +++ b/src/addons/search/search.test.ts @@ -13,19 +13,12 @@ class MockTerminalPlain {} class MockTerminal { private _core: any; -<<<<<<< HEAD public searchHelper: TestSearchHelper; - constructor(options: any) { - this._core = new (require('../../../lib/Terminal').Terminal)(options); - this.searchHelper = new TestSearchHelper(this as any); -======= - public searchHelper: ISearchHelper; public cols: number; constructor(options: any) { this._core = new (require('../../../lib/Terminal').Terminal)(options); - this.searchHelper = new SearchHelper(this as any); + this.searchHelper = new TestSearchHelper(this as any); this.cols = options.cols; ->>>>>>> Fixed issues around searching lines twice and considering a wrapped line both it's own line and part of the previous line. } get core(): any { return this._core;