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/Core.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/Core.zig')
| -rw-r--r-- | src/Core.zig | 23 |
1 files changed, 6 insertions, 17 deletions
diff --git a/src/Core.zig b/src/Core.zig index 38493b93..a455cf1c 100644 --- a/src/Core.zig +++ b/src/Core.zig @@ -1777,7 +1777,7 @@ pub fn sync(p: *Pardes) void { // The session's part of the pane's view geometry (File.geometry), // and its context declarations. if (pane.file) |*f| pardes.panes.File.refreshContext(p, pane, f); - pane.view = .{ .wrap = p.settings.wrap, .layered = p.settings.tree_context_tag_style, .body_h = p.row_metrics.body_h, .tagline_h = p.row_metrics.tagline_h, .rect_h = r.h }; + pane.view = .{ .wrap = p.settings.wrap, .body_h = p.row_metrics.body_h, .tagline_h = p.row_metrics.tagline_h, .rect_h = r.h }; // The tag takes a row per line, leaving the body one row if it // had any; a folded pane shows its first line only. Its prefix // is made once, on the stack: this runs on every event, and not @@ -2366,7 +2366,7 @@ test "LocationsConfig command reports partial updates and survives restore" { try std.testing.expectEqual(expected, restored.locations_config); } -test "TreeContext tag style preserves message rows and its opt-out survives restore" { +test "TreeContext rows in the tag style keep the message rows" { if (comptime !syntax.enabled) return error.SkipZigTest; const p = try Pardes.init(std.testing.allocator, .{ .tty_only = true, .cols = 60, .rows = 16 }); defer p.deinit(); @@ -2380,7 +2380,6 @@ test "TreeContext tag style preserves message rows and its opt-out survives rest pane.msg_len = 0; p.sync(); _ = try p.render(p.scratch.allocator()); - try std.testing.expect(p.settings.tree_context_tag_style); const full_height = p.surface.body_layers[0].viewport.h; try std.testing.expect(p.surface.body_layers[0].rows > full_height); try std.testing.expectEqual(FontRole.tagline, p.surface.body_layers[0].cells[0].style.font_role); @@ -2408,16 +2407,6 @@ test "TreeContext tag style preserves message rows and its opt-out survives rest _ = try p.render(p.scratch.allocator()); try std.testing.expectEqual(full_height, p.surface.body_layers[0].viewport.h); p.prefix = .none; - try std.testing.expect(p.executeBuiltinLine(0, "TreeContextTagStyle")); - p.sync(); - _ = try p.render(p.scratch.allocator()); - try std.testing.expectEqual(@as(u16, 0), p.surface.body_layers[0].rows); - try std.testing.expectEqual(@as(u16, 0), pane.body_rows); - try std.testing.expectEqual(FontRole.body, p.surface.at(r.x + config.GUTTER, p.bodyTop(pane, r)).style.font_role); - try dump.dumpState(p); - const restored = try dump.initFromDump(p.gpa, .{ .tty_only = true }, p.dump_out.?); - defer restored.deinit(); - try std.testing.expect(!restored.settings.tree_context_tag_style); } test "TreeContext command and custom tag survive a workspace round trip" { @@ -3452,8 +3441,6 @@ test "tabbed file aligns syntax cursor and mouse at the nearest insertion gap" { const gpa = std.testing.allocator; const p = try Pardes.init(gpa, .{ .cols = 60, .rows = 12 }); defer p.deinit(); - // Bold is an explicit preference; use it to expose the glyph boundaries. - try std.testing.expect(p.executeBuiltinLine(0, "SyntaxBold")); const pane = try p.setTestFile("\treturn x\n"); const f = &pane.file.?; f.highlights = try p.tree_sitter_gpa.alloc(u8, f.content.len); @@ -3469,10 +3456,12 @@ test "tabbed file aligns syntax cursor and mouse at the nearest insertion gap" { const rect = p.rects[0]; const text_x = rect.x + config.GUTTER + config.PREFIX_W; const body_y = rect.y + BOX_H; + // The keyword's ink shows the glyph boundaries. + const kw: Color = .{ .rgb = p.theme().kw }; for (0..config.tab_width) |col| - try std.testing.expect(!surface.at(text_x + @as(u16, @intCast(col)), body_y).style.bold); + try std.testing.expect(!std.meta.eql(kw, surface.at(text_x + @as(u16, @intCast(col)), body_y).style.fg)); for (0.."return".len) |col| - try std.testing.expect(surface.at(text_x + config.tab_width + @as(u16, @intCast(col)), body_y).style.bold); + try std.testing.expectEqual(kw, surface.at(text_x + config.tab_width + @as(u16, @intCast(col)), body_y).style.fg); try std.testing.expectEqual(text_x + config.tab_width, surface.cursor.?.x); const click_x = text_x + config.tab_width + 2; |
