mirror of
https://github.com/MeexReay/poshlostios.git
synced 2025-06-24 18:42:59 +03:00
fix remove lines 3 time
This commit is contained in:
parent
d2db0ee2e7
commit
fd45ace05d
@ -79,6 +79,9 @@ async function main(args) {
|
|||||||
|
|
||||||
if (event.type == "key") {
|
if (event.type == "key") {
|
||||||
if (event.key == "Backspace") {
|
if (event.key == "Backspace") {
|
||||||
|
if (pos[0] == 0 && pos[1] == 0) {
|
||||||
|
continue
|
||||||
|
}
|
||||||
let index = axisToIndex(content.split("\n"), pos)
|
let index = axisToIndex(content.split("\n"), pos)
|
||||||
content = content.slice(0, index - 1) + content.slice(index)
|
content = content.slice(0, index - 1) + content.slice(index)
|
||||||
if (pos[0] > 0) {
|
if (pos[0] > 0) {
|
||||||
@ -86,6 +89,7 @@ async function main(args) {
|
|||||||
} else {
|
} else {
|
||||||
if (pos[1] > 0) {
|
if (pos[1] > 0) {
|
||||||
pos[1]--
|
pos[1]--
|
||||||
|
pos[0] = content.split("\n")[pos[1]].length
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (event.key == "Delete") {
|
} else if (event.key == "Delete") {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user