fix y not defined

This commit is contained in:
MeexReay 2025-03-21 21:45:06 +03:00
parent a1dee4f220
commit d0d3060a54

View File

@ -68,7 +68,7 @@ async function main(args) {
} else if (event.key == "ArrowLeft") { } else if (event.key == "ArrowLeft") {
pos[0] = Math.max(0, pos[0] - 1) pos[0] = Math.max(0, pos[0] - 1)
} else if (event.key == "ArrowRight") { } else if (event.key == "ArrowRight") {
pos[0] = Math.min(content.split("\n")[y].length, pos[0] + 1) pos[0] = Math.min(content.split("\n")[pos[1]].length, pos[0] + 1)
} else if (event.key == "Escape") { } else if (event.key == "Escape") {
mode = "normal" mode = "normal"
} else if (event.key == "Insert") { } else if (event.key == "Insert") {