Editor
The editor (system/edit/edit.rio, a system app) edits a file at a time, by
path (an app's source, its other files, its help, its saves), up to 32 KB, with the keys of most
editors. Ctrl+O opens one through Files, and Ctrl+Shift+S saves as another, through Files too, which
asks where. Ctrl+R saves it and runs the app or project it's in, and the system key with Tab comes back
to the editor. If the app stopped with an error, a compile error or a runtime one, the editor comes
back at it: in the file it was in (one of the app's parts, say), the cursor on it, and what was wrong
at the bottom. Ctrl+Shift+P (or the system key with P) lists every command, with its keys.
Projects are where apps are worked on: chord+ is app chord in work, in /projects, with saves
of its own (a copy of the app's), so trying things can't spoil the app's. An installed app's files are
read only, for reading; saving one saves it in the app's project, made from the app first, and Ctrl+R
on it, unchanged, runs the app. Files (or the console's install chord) installs project chord+ as
the app.
The app or project of the file it has open is the active one, the whole Rinc's setting, and it starts with what's active (another app can pick one for it), else the file it had last, where it was.
Keys
| keys | |
|---|---|
| arrows, Home, End, Page Up, Page Down | move: with Ctrl, by words and to either end; with Shift, select |
| Ctrl+O, Ctrl+S, Ctrl+Shift+S | open a file (Files picks it), save it, save it as another (Files picks where) |
| Ctrl+Tab, Ctrl+Shift+Tab | the files had lately (the last 8), listed while Ctrl's held: Tab moves down it (Shift+Tab up), letting go of Ctrl opens the one picked where it was, and Esc closes it. A quick Ctrl+Tab goes back and forth between two |
| Ctrl+W | close this file: out of the files had lately, the one before it opened where it was (none left: a new file). Not saved: Ctrl+W again drops the changes |
| Ctrl+R, Ctrl+N | save and run its app or project, start a new file |
| Ctrl+Shift+P | every command, to type to narrow and pick one (the system's list: the system key with P too) |
| Ctrl+Z, Ctrl+Y (or Ctrl+Shift+Z) | undo, redo |
| Ctrl+X, Ctrl+C, Ctrl+V | cut, copy, paste (the whole line, with nothing selected), on the clipboard every app shares: text another app copied pastes here too |
| Ctrl+A, Ctrl+L | select all, select the line (and the next, again) |
| Tab, Shift+Tab | indent, outdent (the selected lines) |
| Alt+Up, Alt+Down, Ctrl+Shift+K | move the lines up or down, delete them |
| Ctrl+Shift+J | join the next line onto this one (or the selected lines) |
| Ctrl+Space | complete the word |
| Ctrl+/ | comment the lines (the selected ones, or the cursor's), or uncomment them |
| Ctrl+Backspace, Ctrl+Delete | delete a word |
| Ctrl+F, Ctrl+G | find (Enter finds the next), go to a line |
| Esc | let go of the selection, or close the bar at the bottom |
With a mouse, a click puts the cursor there and dragging selects (past the top or bottom, scrolling), and the wheel scrolls (sideways too, tilted, or on a trackpad, as far as the longest line in view). In the list of apps that Ctrl+O shows, a click opens one, and a click outside the list closes it. A controller's left stick moves the pointer, A clicks, and the right stick scrolls, up and down or sideways.
Writing Rio
Enter keeps the line's indent, and goes a step further in after a line that opens a block (if, for,
a proc and so on); end, else and case step back out as they're typed. In a comment line, Enter
goes on with the comment (its # again), and on an empty one, ends it. Tab and Backspace move by
whole steps of two spaces in the indent. Rio's keywords, strings, numbers and comments each have a
color of their own.
Ctrl+Space offers what could finish the word at the cursor, as Rio sees it there: the names in
scope (the proc's own parameters and locals first), with what each is (a variable's type, a proc's
parameters), and Rio's words that fit (a statement's, an expression's, and, or and is after a
value); then the file's own words. With just one, it's put in. After a dot, it's what's before the
dot has: a value's fields and methods (len and push too, where its kind has them), a type's
values and static procs (pc.Rect.), a module's names (pc.). The list opens only for Ctrl+Space,
never by itself, so typing is never held up: Rio's view of the file comes from checking it, up to the
cursor's line, and on the board a big app's check takes about half a second. Typing narrows the list;
Up and Down (and Page Up and Down) pick, Tab or Enter puts the pick in, a click puts one in, and Esc
or any other key closes it.
A pause in typing checks the whole file: its first error is underlined, with a mark beside its line, and what it says shows at the bottom while the cursor's on that line. Line numbers are off at first (a mark beside the cursor's line stands in for them, and the top bar has its number): ^Shift+P, Line numbers, shows them, and the editor remembers.
Saving a .rio file lays it out the one way, as rio fmt does: only spaces and line breaks change
(and a trailing comma may be added), and the cursor stays on the same code, where it was on the
screen. A list in brackets goes on one line, unless it ends with a trailing comma (then an item a
line) or has a line break after its opening bracket (then its items on a line of their own); add the
comma to put it over lines, and take it off, with Ctrl+Shift+J on the opening bracket's line, to
bring it back. Code between # nofmt and # /nofmt comment lines is left as it is. Ctrl+Z undoes
the layout.
Undo groups typing by words, and goes back as far as the file was opened: it's kept on the card (the editor's stash), so it's there after another app has run, or Rinc has started again. When there's an app with unsaved changes, opening another or starting a new one asks first.