From 536eeb4db09c4787e3197c76e08aef09cc12ce09 Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Sun, 31 May 2026 20:34:13 -0700 Subject: [PATCH] refactor(browser): remove unreachable coords guard in getCoords getCoordsRelativeToElement always returns a two-element tuple, so the array is always truthy and if (!coords) could never run. hasValidCharSize already handles the only early-exit path before coordinates are computed. Co-authored-by: Cursor --- src/browser/input/Mouse.ts | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/browser/input/Mouse.ts b/src/browser/input/Mouse.ts index 5f73743fb..ba8bddaa2 100644 --- a/src/browser/input/Mouse.ts +++ b/src/browser/input/Mouse.ts @@ -37,10 +37,6 @@ export function getCoords(window: Pick, event: Pick< } const coords = getCoordsRelativeToElement(window, event, element); - if (!coords) { - return undefined; - } - coords[0] = Math.ceil((coords[0] + (isSelection ? cssCellWidth / 2 : 0)) / cssCellWidth); coords[1] = Math.ceil(coords[1] / cssCellHeight);