Get multiple matches working after incremental changes
This commit is contained in:
@@ -52,11 +52,12 @@ export class SearchHelper implements ISearchHelper {
|
|||||||
startCol = incremental ? selectionManager.selectionStart[0] : selectionManager.selectionEnd[0];
|
startCol = incremental ? selectionManager.selectionStart[0] : selectionManager.selectionEnd[0];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
console.log(`Start from ${startCol},${startRow}`);
|
||||||
|
|
||||||
this._initLinesCache();
|
this._initLinesCache();
|
||||||
|
|
||||||
// Search from startRow to end
|
// 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);
|
result = this._findInLine(term, { row: y, col: startCol }, searchOptions);
|
||||||
if (result) {
|
if (result) {
|
||||||
break;
|
break;
|
||||||
@@ -111,7 +112,7 @@ export class SearchHelper implements ISearchHelper {
|
|||||||
this._initLinesCache();
|
this._initLinesCache();
|
||||||
|
|
||||||
// Search from startRow to top
|
// 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);
|
result = this._findInLine(term, {row: y, col: startCol}, searchOptions, isReverseSearch);
|
||||||
if (result) {
|
if (result) {
|
||||||
break;
|
break;
|
||||||
@@ -216,6 +217,7 @@ export class SearchHelper implements ISearchHelper {
|
|||||||
resultIndex = searchStringLine.lastIndexOf(searchTerm, searchIndex.col - searchTerm.length);
|
resultIndex = searchStringLine.lastIndexOf(searchTerm, searchIndex.col - searchTerm.length);
|
||||||
} else {
|
} else {
|
||||||
resultIndex = searchStringLine.indexOf(searchTerm, searchIndex.col);
|
resultIndex = searchStringLine.indexOf(searchTerm, searchIndex.col);
|
||||||
|
console.log('resultIndex', resultIndex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user