From e35a9c1e902b3f6aff3d5564161e635abd843a62 Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Sun, 31 May 2026 20:35:49 -0700 Subject: [PATCH] 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 --- addons/addon-search/src/SearchEngine.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/addon-search/src/SearchEngine.ts b/addons/addon-search/src/SearchEngine.ts index 7e89c03a1..1760bc2bd 100644 --- a/addons/addon-search/src/SearchEngine.ts +++ b/addons/addon-search/src/SearchEngine.ts @@ -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`); }