diff options
| author | Gabriel Schneider <[email protected]> | 2026-10-30 15:57:57 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-10-30 16:29:54 -0300 |
| commit | d0ed8056ba90a12fa3bc40ccd8642ec4ae8d9cc0 (patch) | |
| tree | ba31f0dea82f5bd1febdcc189c120268a56e3d51 | |
| parent | f57897b1d8eca7080ba2482a6ed20e1c9fa7d453 (diff) | |
| download | pardes-d0ed8056ba90a12fa3bc40ccd8642ec4ae8d9cc0.tar.gz pardes-d0ed8056ba90a12fa3bc40ccd8642ec4ae8d9cc0.zip | |
pardes: a core's first frontend is an option (Options.windowed, taped with the rest), not its build's default, and every hosted build takes a window's font words (observe_font, acknowledge_font, reject_font, take_font_request): a window's build replaying a terminal's session started as a window (its init file's window settings applied), and a terminal's replica of a window's session diverged at the window's first font
Co-Authored-By: Claude Opus 5.5 <[email protected]>
| -rw-r--r-- | src/pardes.zig | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/src/pardes.zig b/src/pardes.zig index d7f35ed9..f0d2cd0c 100644 --- a/src/pardes.zig +++ b/src/pardes.zig @@ -4338,6 +4338,10 @@ pub const Boot = enum { pub const Options = struct { tty_only: bool = false, + /// The first view's frontend is a window (`Pardes.windowed`), as a + /// window's build says: an option, taped with the rest, so that a + /// window's build replaying a terminal's session starts as it did. + windowed: bool = platform == .gui, /// The layout to boot, when a host means one outright rather than leaving /// it to be read off the options below. `--tty` names `.tty`; a core /// booted for a test names nothing and gets `.tty_shell`. @@ -4560,9 +4564,9 @@ pub const Pardes = struct { /// does /status say whether the pointer is over it (a terminal's mouse /// reports never say it left, so a tty would claim it for ever). /// The live view's frontend is a window (Event.frontend): what it draws, - /// and the words it takes (builtins.zig `here`). A window's build - /// starts so, a terminal's not. - windowed: bool = platform == .gui, + /// and the words it takes (builtins.zig `here`). It starts as + /// `Options.windowed` says. + windowed: bool = false, /// The last plain B1 click, for acme's double-click (text.c:881, /// textselect: a second click at the same point within 500 ms). last_click: ?struct { id: usize, on_tag: bool, row: i32, col: i32, ms: i64 } = null, @@ -4792,6 +4796,7 @@ pub const Pardes = struct { .pdf_gpa = opts.pdf_allocator orelse gpa, .tree_sitter_gpa = opts.tree_sitter_allocator orelse gpa, .opts = opts, + .windowed = opts.windowed, .col_tags = @splat(.{ .what = .column, .gpa = gpa }), .global_tag = .{ .what = .workspace, .gpa = gpa }, .fs = .{}, @@ -5536,8 +5541,12 @@ pub const Pardes = struct { p.settings.shell.pending = false; } + /// A window's font, asked and told (this and the three below): in every + /// hosted build, not only a window's, as only a window's host calls + /// them and a terminal's replica of a window's session must step as + /// the window does. pub fn takeFontRequest(p: *Pardes) ?[]const u8 { - if (comptime !font_picker) return null; + if (comptime !hosted) return null; const taped = tape.enter(p, .take_font_request); defer tape.leave(p, taped); if (!p.settings.font.pending or p.font_request_taken) return null; @@ -5553,7 +5562,7 @@ pub const Pardes = struct { effective_size_hundredths: u16, unit: config.Runtime.FontSizeUnit, ) bool { - if (comptime !font_picker) return false; + if (comptime !hosted) return false; const taped = tape.enter(p, .{ .observe_font = .{ .name = effective_name, .size = effective_size_hundredths, .unit = unit } }); defer tape.leave(p, taped); if (!p.settings.font.effective_name.set(effective_name)) return false; @@ -5570,7 +5579,7 @@ pub const Pardes = struct { effective_size_hundredths: u16, unit: config.Runtime.FontSizeUnit, ) bool { - if (comptime !font_picker) return false; + if (comptime !hosted) return false; const taped = tape.enter(p, .{ .acknowledge_font = .{ .name = effective_name, .size = effective_size_hundredths, .unit = unit } }); defer tape.leave(p, taped); if (!p.settings.font.pending or !p.font_request_taken) return false; @@ -5588,7 +5597,7 @@ pub const Pardes = struct { } pub fn rejectFont(p: *Pardes) void { - if (comptime !font_picker) return; + if (comptime !hosted) return; const taped = tape.enter(p, .reject_font); defer tape.leave(p, taped); if (!p.settings.font.pending or !p.font_request_taken) return; |
