loom
Luce Engineering LuciaOS

The editor

The Luce release includes a full-screen terminal editor written in Luce. Start the installed command directly:

Shell
$ editor main.luc
$ editor main.luc helpers.luc

It is not a privileged part of loom. The installer ships a standalone executable, and the repository also builds a normal editor.lc artifact that loom can run like any other program.

What it does now

  • opens one or more buffers and switches among them;
  • edits UTF-8 text with checked character-boundary movement;
  • saves files and recovers periodic unsaved drafts;
  • provides bounded undo and redo per buffer, with typed runs coalesced into one undo step;
  • finds every in-file match and steps through the results;
  • shows a navigable file pane and a build-output pane;
  • builds and runs the active Luce file, keeping the captured result visible;
  • supports keyboard, resize, and mouse events, including pane focus and draggable pane dividers;
  • draws line numbers, status, pane frames, and Luce syntax highlighting; and
  • updates only changed terminal cells through the termui package.

A recovered draft is not silently accepted as the file. It opens as modified, and the original on-disk content is the first undo state: Ctrl-Z discards the recovery, while Ctrl-S keeps it.

Keyboard

KeyAction
Arrows, Home, End, Page Up, Page DownMove through the active buffer or pane.
Backspace, Delete, Enter, TabEdit text; Tab inserts four spaces.
Ctrl-SSave the active buffer.
Ctrl-BBuild and run the active Luce file; open the output pane.
Ctrl-FOpen in-file search. Enter/arrow movement steps matches; Escape returns to the editor.
Ctrl-Z / Ctrl-YUndo / redo.
Ctrl-EToggle the file pane.
Ctrl-OToggle the output pane.
Ctrl-WMove focus to the next visible pane.
Ctrl-QQuit; press again to confirm when a buffer has unsaved changes.

The terminal host reports named key, text, mouse, resize, and closed events; the editor's own keymap.luc decides what they mean. See the host boundary for that division.

Build/run uses the installed toolchain

Ctrl-B asks the host shell service to run luce build for the active path, then runs the resulting executable and captures combined output. The installed host resolves its sibling luce binary even when a GUI launch gives the editor only /usr/bin:/bin on PATH. That installed-pair behavior has a product test because it is easy for an editor to work in a terminal and fail when launched elsewhere.

The terminal UI is a package

The editor imports the maintained termui package. termui handles the repeated mechanics: a front/back cell surface, frame diff, clipping, styled text, constraint layout, junction-aware borders, input snapshots, rows, and viewports. The application keeps its model, command policy, file behavior, and event loop.

This is an important proof boundary. The renderer and layout can be tested in memory without a real terminal; editor state, search, history, session recovery, mouse layout, and rendering have their own Luce tests; the compiled editor is also exercised end to end.

Current limits

The editor is intentionally still small. It has no replace workflow, selection/clipboard editing, multiple cursors, plugin system, configuration language, or soft line wrapping. It is a proving application for the public language and libraries, not a hidden editor framework.

The language roadmap will eventually add classes, owned mutable interface values, weak references, and capturing closures. A higher-level UI package and this editor will be the end-to-end proof of those features; until then the current explicit state-and-view design remains the honest implementation.