Fix up arrowing to top line always shifting right by one

This commit is contained in:
dylan 2023-05-07 14:05:52 -07:00
parent 5ed92b5ff4
commit 107a5370b1

View File

@ -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 = [