From 107a5370b18637e2cd2fdfa390ca8023ede9dba2 Mon Sep 17 00:00:00 2001 From: dylan <> Date: Sun, 7 May 2023 14:05:52 -0700 Subject: [PATCH] Fix up arrowing to top line always shifting right by one --- codetab.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codetab.ts b/codetab.ts index 48650d3..d9556ac 100644 --- a/codetab.ts +++ b/codetab.ts @@ -230,7 +230,7 @@ const gridToIndex = (str: string, x: number, y: number) => { if (y >= lines.length) { return str.length; } - return lines.slice(0, y).join("\n").length+Math.min(x, lines[y].length)+1; + return lines.slice(0, y).join("\n").length+Math.min(x, lines[y].length)+(y === 0 ? 0 : 1); } const keywords = [