mirror of
https://github.com/curioustorvald/tsvm.git
synced 2026-06-13 16:04:05 +09:00
edit.js: home/end to move text cursor
This commit is contained in:
@@ -331,6 +331,12 @@ while (!exit) {
|
|||||||
else if (key == con.KEY_RIGHT && cursorCol < textbuffer[cursorRow].length) {
|
else if (key == con.KEY_RIGHT && cursorCol < textbuffer[cursorRow].length) {
|
||||||
nextCol(); drawLnCol(); gotoText();
|
nextCol(); drawLnCol(); gotoText();
|
||||||
}
|
}
|
||||||
|
else if (key == con.KEY_HOME) {
|
||||||
|
cursorCol = 0; scrollHor = 0; drawTextLine(cursorRow - scroll); drawLnCol(); gotoText();
|
||||||
|
}
|
||||||
|
else if (key == con.KEY_END) {
|
||||||
|
cursorCol = textbuffer[cursorRow].length; scrollHor = textbuffer[cursorRow].length - paintWidth + 2; drawTextLine(cursorRow - scroll); drawLnCol(); gotoText();
|
||||||
|
}
|
||||||
else if (key >= 32 && key < 128) { // printables (excludes \n)
|
else if (key >= 32 && key < 128) { // printables (excludes \n)
|
||||||
appendText(key);
|
appendText(key);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user