BASIC line editor: cursor keys, Home/End, Delete, and Right to recall a line
Typing a line number and pressing Right brings that program line up to edit. Left/Right move, Home/End (Ctrl-A/Ctrl-E) jump, typing inserts, Backspace and Delete remove, Enter takes the whole line; long lines wrap. To fit the ROM, the date code is smaller and SDCC gets more allocator effort; build.sh now fails if the code runs past 8000h. basic/test-edit.py checks the editor in the emulator. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
073db68754
commit
eb72d85834
8 files changed
+6473
-6227
No files matched your search
+19
-3
@@ -44,17 +44,33 @@ RUN
|
||||
```
|
||||
|
||||
- **Ctrl-C** stops a running program.
|
||||
- **Backspace** (or Delete) rubs out the last character.
|
||||
- **Left** and **Right** move the cursor along the line; **Home** and **End**
|
||||
(or Ctrl-A and Ctrl-E) jump to its start and end. What you type goes in at
|
||||
the cursor.
|
||||
- **Backspace** rubs out the character before the cursor, **Delete** the one
|
||||
under it.
|
||||
- **Ctrl-U** erases the whole line.
|
||||
- Cursor keys are ignored.
|
||||
- **Enter** takes the whole line, wherever the cursor is.
|
||||
|
||||
Lines can be up to 250 characters. Lower case is accepted and turned into upper
|
||||
case, except inside quotes.
|
||||
|
||||
### Editing a program
|
||||
|
||||
- To replace a line, type it again with the same number.
|
||||
- To change a line, type its number and press **Right**: the line comes up
|
||||
as `LIST` would show it, with the cursor at the end, ready to edit. Move
|
||||
back with Left or Home, fix it, and press Enter. If there is no such line,
|
||||
Right does nothing.
|
||||
- To copy a line, bring it up the same way and change its number.
|
||||
- To replace a line, you can also type it again with the same number.
|
||||
- To delete a line, type its number alone.
|
||||
|
||||
```
|
||||
10 PRINT "HELO"
|
||||
10→ the line comes back: 10 PRINT "HELO"
|
||||
←←←L Enter now it is 10 PRINT "HELLO"
|
||||
```
|
||||
|
||||
- Lines are kept in number order whatever order you type them in. Number in
|
||||
tens (10, 20, 30…) to leave room for later additions.
|
||||
- Changing the program clears all variables.
|
||||
|
||||
Binary file not shown.
Reference in new issue
Block a user