Compy's code editor keeps your program valid Lua at all times: you change it one block at a time, and a block is saved only when Lua can read it (here, as far as the luaparse library checks). This mockup tries editing a block right where it sits in the program, instead of in a separate field at the bottom of the screen.
Compare: the editor as its principles are read, with a field at the bottom.
| Up / Down | Move one line (one block when "Move by line" is off) |
| Ctrl+Up / Ctrl+Down | Move to the start of the previous / next block |
| PgUp / PgDn | Move one page |
| Home / End | First line / the empty row after the last block |
| Alt+Up/Down, Alt+PgUp/PgDn | Scroll the view only |
| Enter (Tab with the Tab switch) | Edit the highlighted block, cursor on the highlighted line |
| typing | Start a new line at the highlighted line, inside its block; on a blank line, the code replaces it. With "Move by line" off: a new block above the highlight |
| Ctrl+Enter | New empty block below the highlight |
| Enter | Save the block (reformats it); if the code is unfinished at the end, start a new line |
| Shift+Enter | New line |
| Esc | Cancel (asks first if you changed something) |
| arrows, Home, End | Move the cursor inside the block; Up/Down stop at its first/last line |
| PgUp/PgDn, Alt+arrows | Scroll the view; the block may leave the screen |
| arrows, Enter, Esc, typing | When the block is out of view: bring it back first (typed letters are kept) |