cursor fix

This commit is contained in:
MeexReay 2025-03-21 21:40:37 +03:00
parent 22643995b5
commit e55f3149f5

View File

@ -64,11 +64,11 @@ async function main(args) {
} else if (event.key == "ArrowUp") { } else if (event.key == "ArrowUp") {
pos[1] = Math.max(0, pos[1] - 1) pos[1] = Math.max(0, pos[1] - 1)
} else if (event.key == "ArrowDown") { } else if (event.key == "ArrowDown") {
pos[1] = Math.min(height - 2, pos[1] + 1) pos[1] = Math.min(content.split("\n").length-1, pos[1] + 1)
} 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(height - 1, pos[0] + 1) pos[0] = Math.min(content.split("\n")[y].length - 1, 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") {
@ -99,12 +99,11 @@ async function main(args) {
screen_length += status_length screen_length += status_length
if (command == "w") { if (command == "w") {
// save writeFile(args[1], content)
} else if (command == "q") { } else if (command == "q") {
break break
} else if (command == "x") { } else if (command == "x") {
// save writeFile(args[1], content)
break break
} }
} else if (event.char == "i") { } else if (event.char == "i") {