Skip to content

Commit

Permalink
Get multiple matches working after incremental changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyriar committed Dec 26, 2018
1 parent 204e42a commit 76302e2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/addons/search/SearchHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,12 @@ export class SearchHelper implements ISearchHelper {
startCol = incremental ? selectionManager.selectionStart[0] : selectionManager.selectionEnd[0];
}
}
console.log(`Start from ${startCol},${startRow}`);

this._initLinesCache();

// Search from startRow to end
for (let y = incremental ? startRow : startRow + 1; y < this._terminal._core.buffer.ybase + this._terminal.rows; y++) {
for (let y = startRow; y < this._terminal._core.buffer.ybase + this._terminal.rows; y++) {
result = this._findInLine(term, { row: y, col: startCol }, searchOptions);
if (result) {
break;
Expand Down Expand Up @@ -111,7 +112,7 @@ export class SearchHelper implements ISearchHelper {
this._initLinesCache();

// Search from startRow to top
for (let y = incremental ? startRow : startRow - 1; y >= 0; y--) {
for (let y = startRow; y >= 0; y--) {
result = this._findInLine(term, {row: y, col: startCol}, searchOptions, isReverseSearch);
if (result) {
break;
Expand Down Expand Up @@ -216,6 +217,7 @@ export class SearchHelper implements ISearchHelper {
resultIndex = searchStringLine.lastIndexOf(searchTerm, searchIndex.col - searchTerm.length);
} else {
resultIndex = searchStringLine.indexOf(searchTerm, searchIndex.col);
console.log('resultIndex', resultIndex);
}
}

Expand Down

0 comments on commit 76302e2

Please sign in to comment.