A barely functional GUI text editor
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Bryan cfd1c9c453 the editor in the terminal: ctrl+x and ctrl+z claimed, a regress run there
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 14:19:54 +01:00
examples the editor in the terminal: ctrl+x and ctrl+z claimed, a regress run there 2026-11-01 14:19:54 +01:00
scripts the editor in the terminal: ctrl+x and ctrl+z claimed, a regress run there 2026-11-01 14:19:54 +01:00
.gitignore the editor 2026-10-24 00:39:13 +02:00
editor.talc the editor in the terminal: ctrl+x and ctrl+z claimed, a regress run there 2026-11-01 14:19:54 +01:00
README the editor as one form through (toolkit host) 2026-11-01 14:01:07 +01:00
VERSION the editor 2026-10-24 00:39:13 +02:00

editor: a directory at the left and files open in tabs and edited in
the middle -- the shape of Visual Studio Code's file pane and editor,
cut down to what a person at this machine reaches for. A program in a
repository of its own, built against ../toolkit and the libraries
beside it. Its whole interface is one form of (toolkit form)'s, shown
through (toolkit host): in the terminal it runs in, which builds the
parts itself, or in a window of its own. The shell is not here: it has
a window of its own, ../terminal.

  editor.talc           the program: the form (a row with the
                        directory's path and two buttons, the list, a
                        sash, tabs of texts over a bar, a status line),
                        the copy of each tab's lines, files opened,
                        saved and closed, what the keys do
  examples/files/       a directory the regress opens: two files and a
                        directory with one more
  examples/drive.talc   what the regress plays at it: a file opened from
                        the list, a line typed at its top and saved, a
                        second file, the sash dragged, a word found in
                        the tab, the tab row crowded with new tabs
  examples/drive-classic.talc   the first step again, in the classic look
  examples/hello.expected   the file as the drive leaves it
  examples/*.ppm        the pictures expected at each step
  scripts/build.sh      builds editor.talc into bin/editor
  scripts/regress.sh    runs it under ../screen with no card on a copy of
                        examples/files, twice (the built-in look, the
                        classic one), and compares the pictures and the
                        saved file

Build:

  scripts/build.sh
  scripts/regress.sh

which need the installed toolchain (compiler on PATH), ../canvas built
(its fonts), ../look (its example themes and its icons), ../toolkit, and for the
regress ../screen built. Start it from the launcher (`editor`), the
screen's -run, or a terminal.

  editor [-window] [path ...]

With no path the working directory is shown; a directory given is
shown; files given are opened in tabs, and the first one's directory
shown when no directory was. Under a terminal it is shown there, else
in a window (800 by 500 to begin with, following the screen from then
on); -window asks for a window under a terminal too.

WHERE THE TEXT IS. The text is typed where it is shown, in the parts
-- in the window's text areas, or the terminal's -- so typing never
waits on this program. Every edit is told here as a form, typed,
pasted, undone or put in by the program, and each tab keeps a copy of
its lines moved by those edits alone; that copy is what is saved and
what finding searches. A file read in is put into its text in pieces
under the 64 KiB a form may be, which change nothing to save. Changes
this program makes (a tab shown, the bar, the focus) travel the other
way, so a key pressed straight after ctrl+f may reach the text before
the bar's field has the focus.

WHAT IT SHOWS. A row across the top: a button that goes up one
directory, one that goes to /, and the directory's path. Under it the
list, the whole height at the left; a sash; and the tabs over the text
in a framed page, with the bar below them when it has something to
show. A status line along the bottom: the full path of the file being
edited (its name and "not saved yet" for a new tab), nothing when no
tab is open. The list holds what the directory holds: ".." first, then
the directories with a "/" after their names, then the files, dot files
shown, in the order the directory gives them, each with the icon for
what it is -- a folder, a talc file, a file that may be run, any other
file -- where there is a screen to draw it. A press on a line (or
return, with the focus in the list, which has it at the start) opens
it: a directory becomes the one shown and the title, a file a tab, or
raises the tab it already has; backspace goes up one directory; F5
reads it again (nothing watches it). The tabs are ../toolkit's, a 1995
tab control in a look that raises its faces and outlined in a flat one,
the one shown standing higher, a "*" after one with unsaved changes; a
press chooses, a middle press closes, a row wider than the window
scrolls. The text is dina-13 in a window, with line numbers, a cursor
and a selection, undo, and the keys in ../toolkit/README.

FILES. A file is read whole and split at its newlines; it is written
with a newline after every line, the last included (a file that had
none gets one). Saving compares the file's modification time with the
one it had when read or last written: when the file changed under the
editor the bar asks whether to overwrite, and nothing merges. A tab
opened with ctrl+n has no file until it is saved; saving it, or
ctrl+shift+s on any tab, shows the bar with a field for the name
(relative to the directory shown, or a full path), return saves and
escape puts the bar away. Closing a tab with unsaved changes (ctrl+w, a
middle press) asks Save, Discard or Cancel in the bar.

ROLES. The lines of a .talc or .theme file are coloured as talc by
(toolkit colourers): comments, strings, values, and a form's name as a
keyword when it is the first word after an open parenthesis.

FINDING. ctrl+f shows the bar with a field: as the text is typed the
first match at or after the last one found is selected (from the top
again when there is none further on), return and down go to the next,
up to the previous, escape puts the bar away and leaves the selection.

THE KEYS, beyond the parts' own: ctrl+s saves the tab, ctrl+shift+s
saves it under a name, ctrl+f finds, ctrl+n opens a new tab, ctrl+w
closes the tab, ctrl+tab and ctrl+shift+tab go round the tabs, ctrl+1
to ctrl+9 choose one, F5 reads the directory again, escape puts the bar
away. In the text ctrl+z is undo and ctrl+x cut.

NOT HERE YET: replace; the matching parenthesis; colouring for other
files (a shell file), and a tab's colouring changed when it is saved
under another name; a tree in the directory pane; the icons of another
look's pack when the look changes; finding from the cursor (the
program is not told where it is); a file larger than memory likes
(nothing caps it yet, and each edit rebuilds the copy's list of lines).