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. 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.
Keys: browsing
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 (or Tab)
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
Keys: editing
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)
What the mockup leaves out
Formatting on save re-indents only: spacing inside a line is kept.
No undo, copy/cut/paste, block delete, reorder, search, or file saving.
Blocks are split with luaparse (Lua 5.1), close to the IDE's splitter.