summaryrefslogtreecommitdiff
path: root/src/config.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-05 22:40:49 -0300
committerGabriel Schneider <[email protected]>2026-11-05 23:58:31 -0300
commitdfcc040ac979b695dc2e68b9d866c2769ba6d928 (patch)
treecd88c998b46f758a7c74e3d800312d968d6303ac /src/config.zig
parentf930d53c58187381b2f0df6892546ac1c217c9db (diff)
downloadpardes-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/config.zig')
-rw-r--r--src/config.zig29
1 files changed, 4 insertions, 25 deletions
diff --git a/src/config.zig b/src/config.zig
index bea5dbbf..edfaf3ed 100644
--- a/src/config.zig
+++ b/src/config.zig
@@ -123,11 +123,7 @@ pub const leader_path = paths: {
.JumpScope = null,
.Debug = "td",
.Msg = null,
- .Colors = "tc",
- .FocusTint = null,
- .SyntaxBold = null,
.Verbose = null,
- .TreeContextTagStyle = null,
.Wrap = "tw",
.NextColor = "tn",
.Themes = "tt",
@@ -160,7 +156,6 @@ pub const leader_path = paths: {
table.set(.DumpDir, null);
if (builtins.capabilities.window_opacity) table.set(.WindowOpacity, null);
if (builtins.capabilities.window_blur) table.set(.WindowBlur, null);
- if (builtins.capabilities.ligatures) table.set(.Ligatures, null);
if (builtins.capabilities.pixels) table.set(.CursorBlink, null);
table.set(.JumpTrail, null);
table.set(.ProgramEsc, null);
@@ -687,19 +682,12 @@ pub const kill_to_line_end: []const Chord = &.{.{ .cp = 'k', .ctrl = true }};
pub const Runtime = struct {
theme: usize = 0,
- colors: bool = true,
wrap: bool = true,
- tree_context_tag_style: bool = true,
debug: bool = false,
- focus_tint: bool = true,
/// The workspace tag row. Native shells with their own chrome (the macOS
/// menu bar) turn it off and carry its commands there instead; the core
/// keeps the row as the acme tradition everywhere else.
workspace_tag: bool = true,
- syntax_bold: bool = false,
- /// A font's programming ligatures (`->`, `!=`) draw across their cells.
- /// Only a shell that shapes text has the setting (`Capabilities.ligatures`).
- ligatures: bool = true,
/// How far the unfocused panes' text fades toward its ground, a percent
/// (0 off), kept above the pair's own contrast or 4.5, whichever is
/// lower: a setting alone, which the window draws (gui.zig's Dim) and a
@@ -850,8 +838,6 @@ pub const Runtime = struct {
tagline_font_size: bool,
window_opacity: bool = false,
window_blur: bool = false,
- /// The shell shapes text, so it can draw ligatures and stop drawing them.
- ligatures: bool = false,
/// The shell draws its own pixels (the SDL window): the grip at
/// GripWidth, its own cursor blink, the Pet.
pixels: bool = false,
@@ -859,7 +845,7 @@ pub const Runtime = struct {
pub const Capability = std.meta.FieldEnum(Capabilities);
- pub const Toggle = enum { colors, wrap, tree_context_tag_style, debug, focus_tint, syntax_bold, pager_color, verbose, ligatures, cursor_blink, jump_trail, program_esc };
+ pub const Toggle = enum { wrap, debug, pager_color, verbose, cursor_blink, jump_trail, program_esc };
pub const Action = union(enum) {
toggle: Toggle,
@@ -904,7 +890,6 @@ pub const Runtime = struct {
.window_blur => .window_blur,
.grip_width => .pixels,
.toggle => |field| switch (field) {
- .ligatures => .ligatures,
.cursor_blink => .pixels,
else => null,
},
@@ -915,14 +900,9 @@ pub const Runtime = struct {
// The builtin registry and DumpConfig report share this command table.
pub const settings = [_]Setting{
- .{ .word = "Colors", .action = .{ .toggle = .colors }, .doc = "Syntax colours in text panes, on or off." },
.{ .word = "Wrap", .action = .{ .toggle = .wrap }, .doc = "Long lines wrap onto the next row, on or off." },
- .{ .word = "TreeContextTagStyle", .action = .{ .toggle = .tree_context_tag_style }, .doc = "A pane's TreeContext rows draw in the tag's style, on or off." },
.{ .word = "Debug", .action = .{ .toggle = .debug }, .doc = "A small box of frame statistics at the top right, on or off." },
- .{ .word = "FocusTint", .action = .{ .toggle = .focus_tint }, .doc = "The focused pane's and column's tags are tinted, on or off." },
- .{ .word = "SyntaxBold", .action = .{ .toggle = .syntax_bold }, .doc = "Keywords and the like are drawn bold, on or off." },
.{ .word = "Verbose", .action = .{ .toggle = .verbose }, .doc = "A builtin says its own name on the message row as it runs, on or off." },
- .{ .word = "Ligatures", .action = .{ .toggle = .ligatures }, .doc = "A font's programming ligatures draw across their cells, on or off." },
.{ .word = "CursorBlink", .action = .{ .toggle = .cursor_blink }, .doc = "The cursor blinks, solid while typing, on or off." },
.{ .word = "JumpTrail", .action = .{ .toggle = .jump_trail }, .doc = "A jump of the cursor leaves a short trail that fades, on or off." },
.{ .word = "ProgramEsc", .action = .{ .toggle = .program_esc }, .doc = "In a raw terminal, Esc goes to the program and Shift-Esc backs out, on; off (the default) swaps them." },
@@ -1238,8 +1218,8 @@ pub const Runtime = struct {
test "simple setting application mutates only its plain field" {
var state: Runtime = .{};
- try std.testing.expect(apply(&state, find("Colors").?, null));
- try std.testing.expect(!state.colors);
+ try std.testing.expect(apply(&state, find("Wrap").?, null));
+ try std.testing.expect(!state.wrap);
try std.testing.expect(apply(&state, find("Shell").?, " fish\n"));
try std.testing.expectEqualStrings("fish", state.shell.requested.get());
try std.testing.expect(state.shell.pending);
@@ -1346,7 +1326,6 @@ pub const Runtime = struct {
.tagline_font_size = true,
.window_opacity = true,
.window_blur = true,
- .ligatures = true,
.pixels = true,
},
.state = &state,
@@ -1399,7 +1378,7 @@ pub const Runtime = struct {
try writeReport(&out, defaults_context);
const defaults_report = storage[0..out.end];
// A setting this shell does not have reads so, as a comment.
- for ([_][]const u8{ "# WindowOpacity unsupported\n", "# WindowBlur unsupported\n", "# Font unsupported\n", "# TaglineSize unsupported\n", "# Ligatures unsupported\n" }) |expected|
+ for ([_][]const u8{ "# WindowOpacity unsupported\n", "# WindowBlur unsupported\n", "# Font unsupported\n", "# TaglineSize unsupported\n" }) |expected|
try std.testing.expect(std.mem.indexOf(u8, defaults_report, expected) != null);
try std.testing.expect(std.mem.indexOf(u8, defaults_report, "Font in use") == null);
// Every line before the blank one is a ctl word and its value, or a