fix(addon-search): reject startCol equal to terminal column count
Valid column indices are 0 through cols - 1. The previous check used startCol > cols, so on an 80-column terminal column 80 was accepted while column 100 correctly threw. Use >= so the out-of-range guard matches the documented error for invalid search positions. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -60,7 +60,7 @@ export class SearchEngine {
|
||||
this._terminal.clearSelection();
|
||||
return undefined;
|
||||
}
|
||||
if (startCol > this._terminal.cols) {
|
||||
if (startCol >= this._terminal.cols) {
|
||||
throw new Error(`Invalid col: ${startCol} to search in terminal of ${this._terminal.cols} cols`);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user