throw for invalid row or col
This commit is contained in:
@@ -168,6 +168,10 @@ export class SearchAddon implements ITerminalAddon {
|
|||||||
this.clearDecorations();
|
this.clearDecorations();
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
if (startRow > this._terminal.rows || startCol > this._terminal.cols) {
|
||||||
|
throw new Error(`Invalid row: ${startRow} or col: ${startCol} to search in terminal with ${this._terminal.rows} rows and ${this._terminal.cols} cols`);
|
||||||
|
}
|
||||||
|
|
||||||
let result: ISearchResult | undefined = undefined;
|
let result: ISearchResult | undefined = undefined;
|
||||||
|
|
||||||
this._initLinesCache();
|
this._initLinesCache();
|
||||||
|
|||||||
Reference in New Issue
Block a user