fix(addon-search): advance highlight scan by buffer match size (#5994)
* fix(addon-search): advance highlight scan by buffer match size _highlightAllMatches() stepped to the next find() using term.length and col + 1 when staying on the same row. Search results expose size in buffer columns (wide glyphs, wrapped matches), which select() and decorations already use. Advance with col + size and wrap row/col when crossing the terminal width so highlight-all does not skip, duplicate, or stop early on non-ASCII matches. Co-authored-by: Cursor <cursoragent@cursor.com> * test(addon-search): regression for highlight-all wide char advance by size Co-authored-by: Daniel Imms <Tyriar@users.noreply.github.com> * test(addon-search): move highlight-all regression to integration tests Co-authored-by: Daniel Imms <Tyriar@users.noreply.github.com> --------- Co-authored-by: Cursor <cursoragent@cursor.com> Co-authored-by: Daniel Imms <Tyriar@users.noreply.github.com>
This commit is contained in:
co-authored by
Cursor
Daniel Imms
parent
f57b8e1534
commit
3cdbc77386
@@ -142,12 +142,14 @@ export class SearchAddon extends Disposable implements ITerminalAddon, ISearchAp
|
||||
}
|
||||
prevResult = result;
|
||||
results.push(prevResult);
|
||||
result = this._engine.find(
|
||||
term,
|
||||
prevResult.col + prevResult.term.length >= this._terminal.cols ? prevResult.row + 1 : prevResult.row,
|
||||
prevResult.col + prevResult.term.length >= this._terminal.cols ? 0 : prevResult.col + 1,
|
||||
searchOptions
|
||||
);
|
||||
const cols = this._terminal.cols;
|
||||
let nextCol = prevResult.col + prevResult.size;
|
||||
let nextRow = prevResult.row;
|
||||
if (nextCol >= cols) {
|
||||
nextRow += Math.floor(nextCol / cols);
|
||||
nextCol = nextCol % cols;
|
||||
}
|
||||
result = this._engine.find(term, nextRow, nextCol, searchOptions);
|
||||
}
|
||||
|
||||
this._resultTracker.updateResults(results, this._highlightLimit);
|
||||
|
||||
Reference in New Issue
Block a user