fix backspace delete line wtf omg iaebaln

This commit is contained in:
MeexReay 2025-03-21 22:17:19 +03:00
parent f4a7b7952a
commit d2db0ee2e7

View File

@ -81,10 +81,12 @@ async function main(args) {
if (event.key == "Backspace") {
let index = axisToIndex(content.split("\n"), pos)
content = content.slice(0, index - 1) + content.slice(index)
if (pos[0] == 0 && pos[1] > 0) {
pos[1]--
} else {
if (pos[0] > 0) {
pos[0]--
} else {
if (pos[1] > 0) {
pos[1]--
}
}
} else if (event.key == "Delete") {
let index = axisToIndex(content.split("\n"), pos)