mirror of
https://github.com/MeexReay/poshlostios.git
synced 2025-06-24 18:42:59 +03:00
fix read line
This commit is contained in:
parent
ee80265097
commit
298b4a07bc
@ -31,14 +31,14 @@ async function readLine(on_key=(key, ctrl, alt, shift, content, pos) => [content
|
|||||||
if (pos >= 1) {
|
if (pos >= 1) {
|
||||||
content = content.slice(0, pos - 1) + content.slice(pos)
|
content = content.slice(0, pos - 1) + content.slice(pos)
|
||||||
pos -= 1
|
pos -= 1
|
||||||
setTerminal(start_terminal.substring(0, terminal_text.length-length) + content)
|
setTerminal(start_terminal + content)
|
||||||
let cursor = getCursor()
|
let cursor = getCursor()
|
||||||
setCursor(cursor[0]-1, cursor[1])
|
setCursor(cursor[0]-1, cursor[1])
|
||||||
updateTerminalWOCursor()
|
updateTerminalWOCursor()
|
||||||
}
|
}
|
||||||
} else if (event.key == "Delete") {
|
} else if (event.key == "Delete") {
|
||||||
content = content.slice(0, pos) + content.slice(pos + 1)
|
content = content.slice(0, pos) + content.slice(pos + 1)
|
||||||
setTerminal(start_terminal.substring(0, terminal_text.length-length) + content)
|
setTerminal(start_terminal + content)
|
||||||
updateTerminalWOCursor()
|
updateTerminalWOCursor()
|
||||||
} else if (event.key == "ArrowLeft") {
|
} else if (event.key == "ArrowLeft") {
|
||||||
let cursor = getCursor()
|
let cursor = getCursor()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user