mirror of
https://github.com/MeexReay/poshlostios.git
synced 2025-06-24 18:42:59 +03:00
cursor when backspace fix
This commit is contained in:
parent
31762b74a2
commit
f4a7b7952a
@ -81,6 +81,11 @@ async function main(args) {
|
|||||||
if (event.key == "Backspace") {
|
if (event.key == "Backspace") {
|
||||||
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 && pos[1] > 0) {
|
||||||
|
pos[1]--
|
||||||
|
} else {
|
||||||
|
pos[0]--
|
||||||
|
}
|
||||||
} else if (event.key == "Delete") {
|
} else if (event.key == "Delete") {
|
||||||
let index = axisToIndex(content.split("\n"), pos)
|
let index = axisToIndex(content.split("\n"), pos)
|
||||||
content = content.slice(0, index) + content.slice(index + 1)
|
content = content.slice(0, index) + content.slice(index + 1)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user