Code Editor

The Treescript code editor features syntax highlighting and unlimited undo. The user is always in one of three modes: Structure, Free-Form, and Code Menu. Free-Form mode has 2 operator modes: Prefix and Infix.

 

Structure Mode

Operator Mode is always Prefix (operators come before their operands). Cursor keys (up, down, left, right) move highlighting to (previous, next, parent, first/current child). Pressing a printable char. key incrementally selects matching menu item (backspace undoes that feature). Pressing Enter/Spacebar selects incremental menu item, if any. Otherwise, display text cursor, insert space after/before cursor. Pressing Ctrl+Enter inserts a newline char.

 

Free-Form Mode

Operator Mode is either Prefix (operators come before their operands, the default), or Infix (operators come between their operands). Press Ctrl+O to toggle Operator Mode. Press Esc to toggle Structure/Free-Form Mode.

 

Code Menu Mode

Press Question Mark (?) to enter/exit Code Menu Mode. Press Esc to show/hide code menu.

 

A popup menu above or below text cursor (and including text cursor) is displayed. The contents of this menu include all valid code elements in the context of the text cursor (ignoring anything after the text cursor). If the current menu item refers to a list, the entire list is highlighted (defaults to light gray if background color of whitespace is white).

 

Cursor keys (up, down, left, right) move selection up/down or select parent/child menu (if any). Pressing a printable char. key incrementally selects matching menu item (backspace undoes that feature).

 

Pressing Enter/Spacebar goes to lower level menu, or if none, insert current menu item and go to next menu item, or if none, go to parent code menu. If Spacebar was pressed originally, exit Code Menu Mode.