diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-17 06:01:44 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-17 12:15:01 -0300 |
| commit | 56274a68fb7a418625f01d479ced9fbfc19383f2 (patch) | |
| tree | 09caef7ced4ce0c39da9c464f65289ae5e35b3d6 /src/Dir.zig | |
| parent | 82d998af568caebd7fe28c4f6fb7feb1bfb4572f (diff) | |
| download | pardes-56274a68fb7a418625f01d479ced9fbfc19383f2.tar.gz pardes-56274a68fb7a418625f01d479ced9fbfc19383f2.zip | |
lib: the text pane as a library, `pardes-editor` (docs/next-editor.md, R5): src/lib_editor.zig is an editor a program keeps as plain data (`Editor(capacity)`: a gap buffer for the text, Text's cursor fields by name, two byte rings of whole-text snapshots for undo and redo, registers as records; no pointer, no allocator), thawed into a Text and Registers in the allocator a call is handed, run through normal.zig and edit.zig as a pane's keys run, and frozen back, a key that does not fit refused whole (`key`, `run`, `selectRegex`, `setText`, `setRegister`; `Outcome` done, pending, unbound, action, refused), and `Syntax`, a parse derived from a grammar handed in; the seam is `pardes_config.lib`, true in the library's build alone: Text.pane is null at compile time there, a body's characters and undo are its own (flatSurface, editText, setEditTextSpan, pushUndo, undoStep), bodyFile and filePane are none, Esc and `*` do the text's part only and `+` is a plain register, and config.zig's check of the builtins' leader paths is the editor's; normal.textKey is the mode dispatch keys.zig and the library share, handleNormal hands back the parse and runAction runs an action across the ranges, and applySelRegex's search over the ranges is selectByRegex, which the library calls with a pattern; build.zig: `lib` in the options, mvzr's patch and uucode as functions (patchedMvzr, uucodeModule) the editor's module takes too, editorModule, and `library` exports `pardes-editor` to a package that asks (`.editor = true`: it fetches uucode, mvzr and vaxis, of which it compiles the grapheme width), so a pardes-syntax consumer fetches what it did; test/lib: a value typed into, copied elsewhere and its memory gone, types on equal to one never moved, undo past the ring and redo back, a text that does not fit refused with the value unchanged, an action handed back and a regex done by the caller, a language handed in parsed and coloured; core-test 811 of 950, shell-test 990 of 993, hxdiff 658 / parity 738 / hxgolf 124 with 0 mismatches, replicas pass, lib-test 8 of 8
Diffstat (limited to 'src/Dir.zig')
0 files changed, 0 insertions, 0 deletions
