From 1fc01ab74574b39b345ce31f36bebde642981595 Mon Sep 17 00:00:00 2001 From: minjaesong Date: Fri, 16 Apr 2021 17:31:36 +0900 Subject: [PATCH] edit.js: home/end to move text cursor --- assets/disk0/tvdos/bin/edit.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/assets/disk0/tvdos/bin/edit.js b/assets/disk0/tvdos/bin/edit.js index 0199ad2..b9d3f80 100644 --- a/assets/disk0/tvdos/bin/edit.js +++ b/assets/disk0/tvdos/bin/edit.js @@ -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); }