mirror of
https://github.com/curioustorvald/tsvm.git
synced 2026-03-09 20:51:51 +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) {
|
||||
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)
|
||||
appendText(key);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user