diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-05 22:40:49 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-05 23:58:31 -0300 |
| commit | dfcc040ac979b695dc2e68b9d866c2769ba6d928 (patch) | |
| tree | cd88c998b46f758a7c74e3d800312d968d6303ac /src/builtins.zig | |
| parent | f930d53c58187381b2f0df6892546ac1c217c9db (diff) | |
| download | pardes-dfcc040ac979b695dc2e68b9d866c2769ba6d928.tar.gz pardes-dfcc040ac979b695dc2e68b9d866c2769ba6d928.zip | |
settings #2, five presentation variants go, each now the style it had by default: Colors (text panes and terminals coloured, with SPC t c), TreeContextTagStyle (TreeContext rows in the tag's style), FocusTint (the focused tags tinted), SyntaxBold (keywords not bold) and Ligatures (the window shapes them; gui.zig's syncLigatures and the words' ligatures flag go, and Capabilities.ligatures); the reads deleted are in File.zig, body_layer.zig, Tables.zig, exec.zig's applySettingBuiltin, Core.zig (SessionView.layered left at its default), draw.zig, surface.zig's comment and gui.zig; deleted tests: "settings: Colors off draws a source plain, and on again colours its keywords", "Ligatures is a setting only in the shell that shapes text" and "Ligatures off draws a ligature as its cells' own glyphs, and on shapes it again", and the toggled half of TreeContext's Core test; rewritten through what stays: SyntaxBold's every-row test as keywords coloured in every row, the tag-click tests on JumpTrail, the tag-name tint tests with the focused tag's ink plain, Core's tab test by the keyword's ink; golden changes, each the cut's: syntax, theme, mini and ninep lose their Colors toggles and frames (the message row after them names the builtin before, Mini), and leader, ttyhelp and builtins' Help listing is four columns narrower, TreeContextTagStyle having been its longest word; perf.zig's harness id moves again; the window scenes from 09 on take new gui-goldens lines, the scene no longer writing FocusTint on and its word gone from the message row (the base window build running the same scenes gives the same frames); gates on tui: core-test 965/965, behaviour-test 242/242, unit-test 1482/1483, pane-test 171/172, snap all 105 scripts ok, process-test 0 of 37 failed; gui unit-test 1526/1527, gui-golden 0 of 1 failed
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
Diffstat (limited to 'src/builtins.zig')
| -rw-r--r-- | src/builtins.zig | 34 |
1 files changed, 2 insertions, 32 deletions
diff --git a/src/builtins.zig b/src/builtins.zig index 5186ac55..26d6c770 100644 --- a/src/builtins.zig +++ b/src/builtins.zig @@ -23,9 +23,6 @@ pub const frontend: config.Runtime.Capabilities = .{ .tagline_font_size = pardes.platform != .tui, .window_opacity = pardes.platform == .gui or pardes.platform == .macos, .window_blur = pardes.platform == .macos, - // Only the SDL shell shapes with HarfBuzz and honours the setting. macOS - // draws CoreText ligatures of its own, but nothing there reads it yet. - .ligatures = pardes.platform == .gui, // The grip's width, the cursor's blink and the Pet are the SDL window's. .pixels = pardes.platform == .gui, }; @@ -35,8 +32,8 @@ pub const frontend: config.Runtime.Capabilities = .{ /// its own frontend does (`viewCapabilities`), so a terminal's replica of a /// window's session steps as the window's own does, and back. pub const desktop = pardes.platform == .tui or pardes.platform == .gui; -const window_capabilities: config.Runtime.Capabilities = .{ .font_picker = true, .tagline_font_size = true, .window_opacity = true, .window_blur = false, .ligatures = true, .pixels = true }; -const terminal_capabilities: config.Runtime.Capabilities = .{ .font_picker = false, .tagline_font_size = false, .window_opacity = false, .window_blur = false, .ligatures = false, .pixels = false }; +const window_capabilities: config.Runtime.Capabilities = .{ .font_picker = true, .tagline_font_size = true, .window_opacity = true, .window_blur = false, .pixels = true }; +const terminal_capabilities: config.Runtime.Capabilities = .{ .font_picker = false, .tagline_font_size = false, .window_opacity = false, .window_blur = false, .pixels = false }; /// The words this build has: a desktop build's are the window's. pub const capabilities: config.Runtime.Capabilities = if (desktop) window_capabilities else frontend; @@ -488,33 +485,6 @@ test "Look does not announce itself on the message row; Del still does" { try std.testing.expect(registry.announces(Builtin.Del)); } -test "Ligatures is a setting only in the shell that shapes text" { - const p = try Pardes.init(std.testing.allocator, .{ .tty_only = true }); - defer p.deinit(); - // A desktop build has the word, which a window's view takes alone. - try std.testing.expectEqual(desktop, @hasField(registry.Builtin(), "Ligatures")); - const exists = registry.here(p, .Ligatures); - try std.testing.expectEqual(pardes.platform == .gui, exists); - // Taken either way: run, or said to be GUI-only. - try std.testing.expect(p.executeBuiltinLine(p.active, "Ligatures off")); - try std.testing.expectEqual(!exists, p.settings.ligatures); - var storage: [8192]u8 = undefined; - var out: std.Io.Writer = .fixed(&storage); - try config.Runtime.writeReport(&out, .{ - .startup_config_path = null, - .platform = @tagName(pardes.platform), - .theme_name = p.theme().name, - .compiled_default_shell = config.defaultShell(), - .hover_delay_frames = config.look_preview_delay_frames, - .native_images = false, - .capabilities = viewCapabilities(p), - .state = &p.settings, - }); - try std.testing.expectEqual(exists, std.mem.indexOf(u8, storage[0..out.end], "Ligatures off\n") != null); - // A GUI-only setting reads so elsewhere, as every one the shell lacks. - try std.testing.expectEqual(!exists, std.mem.indexOf(u8, storage[0..out.end], "Ligatures unsupported\n") != null); -} - // ---- the two acme verbs ---- /// Look at its argument: open the file or address it names, else find the word, as a right click does. |
