summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-10-23 10:56:33 -0300
committerGabriel Schneider <[email protected]>2026-10-23 17:10:58 -0300
commita0d367b6c54ff29737662fd7cf5a78d4d183cb20 (patch)
tree295dfa438f54b72a907d2c847784d5b5982fca9e /src/gui
parent7b743fcc7d568f13512a59089c5214bb6fa3282f (diff)
downloadpardes-a0d367b6c54ff29737662fd7cf5a78d4d183cb20.tar.gz
pardes-a0d367b6c54ff29737662fd7cf5a78d4d183cb20.zip
Audit (core, modal): goto/insert/select tables, edit through sam.Op and sam.apply, Turn.bump and awaitPast, dead helpers out
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/gui.zig32
1 files changed, 16 insertions, 16 deletions
diff --git a/src/gui/gui.zig b/src/gui/gui.zig
index a31c6548..d3734fac 100644
--- a/src/gui/gui.zig
+++ b/src/gui/gui.zig
@@ -2567,7 +2567,7 @@ fn localSession(
defer host_io.setExitWake(null, null);
while (!core.quit) {
- pardes.turn.restoreSettled();
+ pardes.turn.bump(&pardes.turn.restores);
try core.pump(host);
if (core.quit) break; // a session that ended does not restore into one
if (core.takeAttach()) |req| {
@@ -2785,7 +2785,7 @@ test "an attached frontend draws the session's chrome from its frame alone" {
try std.testing.expect(pardes.layout.splitColumn(core, 0, 1, false));
core.settings.focus_tint = true;
try std.testing.expect(core.executeBuiltinLine(0, "Msg a notice with a rule under it"));
- pardes.test_api.sync(core);
+ core.sync();
// Past its slide into place, where its rule shows.
for (0..30) |_| core.update(.tick);
const s = try core.render(core.scratch.allocator());
@@ -7016,7 +7016,7 @@ test "every pixel of a grip column is band, button or ring, and the button sits
core.settings.tag_bottom = bottom;
core.active = focus;
pane.file.?.revision = pane.file.?.saved_revision + @intFromBool(dirty);
- pardes.test_api.sync(core);
+ core.sync();
const s = try core.render(core.scratch.allocator());
var g: Gui = undefined;
g.words = .{};
@@ -7327,7 +7327,7 @@ test "lapis plaques stay in their tag's band, clear of every grip; only the focu
try std.testing.expect(pardes.layout.splitColumn(core, 0, 1, false));
try std.testing.expect(core.executeBuiltinLine(0, "Theme lapis"));
for (0..40) |_| core.update(.tick);
- pardes.test_api.sync(core);
+ core.sync();
const s = try core.render(core.scratch.allocator());
try std.testing.expect(s.chrome.decor_box_border != null and s.chrome.decor_checker != null and s.chrome.decor_dots != null and s.chrome.decor_title != null);
var g: Gui = undefined;
@@ -8878,7 +8878,7 @@ test "a lift never touches a tag, a grip or a header, on a light theme or a dark
core.settings.lift = style;
try std.testing.expect(core.executeBuiltinLine(0, "Msg a floating notice"));
core.advance(core.now_ns + 2 * std.time.ns_per_s);
- pardes.test_api.sync(core);
+ core.sync();
const s = try core.render(core.scratch.allocator());
core.advance(core.now_ns + 2 * std.time.ns_per_s);
const settled = try core.render(core.scratch.allocator());
@@ -9748,7 +9748,7 @@ test "a theme's own rules and scrollbar are drawn at its widths: acme's 2px blac
try std.testing.expect(pardes.layout.splitColumn(core, 0, 1, false));
try std.testing.expect(core.executeBuiltinLine(0, "Theme acme"));
for (0..40) |_| core.update(.tick);
- pardes.test_api.sync(core);
+ core.sync();
const s = try core.render(core.scratch.allocator());
try std.testing.expectEqual(@as(u8, 2), s.chrome.rule_px);
// acme's 12px, at GripWidth's 150% default.
@@ -9805,7 +9805,7 @@ test "the scrollbar thumb moves by the pixel and follows a glide" {
// The thumb's top, in window pixels.
fn top(gui: *Gui, p: *pardes.Pardes) !f32 {
gui.decor.clearRetainingCapacity();
- pardes.test_api.sync(p);
+ p.sync();
const s = try p.render(p.scratch.allocator());
var groups = makeGroups(&.{}, false);
try buildDecor(gui, std.testing.allocator, s, &groups, fixedCellLayout(gui), 800, 480, true);
@@ -9839,7 +9839,7 @@ test "the rule between stacked panes stays in the tag band's slack, at any tagli
defer core.deinit();
_ = try core.newShell(1, "");
core.newScratchBelow(0);
- pardes.test_api.sync(core);
+ core.sync();
const s = try core.render(core.scratch.allocator());
const lower = for (s.regionList()) |region| {
if (region.kind == .tag and region.rect.y > 2) break region;
@@ -9879,7 +9879,7 @@ test "an empty column is ruled on both sides, as between two filled ones" {
try std.testing.expect(pardes.layout.splitColumn(core, 0, 1, false));
// Newcol from the left pane: an empty column between the two filled ones.
core.newColumn(0);
- pardes.test_api.sync(core);
+ core.sync();
try std.testing.expectEqual(@as(usize, 3), core.ncol);
try std.testing.expectEqual(@as(usize, 0), core.col_n[1]);
const s = try core.render(core.scratch.allocator());
@@ -9917,7 +9917,7 @@ test "at a 2x display every logical pixel is two: rules, the tag rule, the grip'
try std.testing.expect(pardes.layout.splitColumn(core, 0, 1, false));
try std.testing.expect(core.executeBuiltinLine(0, "Theme acme"));
for (0..40) |_| core.update(.tick);
- pardes.test_api.sync(core);
+ core.sync();
const s = try core.render(core.scratch.allocator());
for ([_]f32{ 1, 2 }) |scale| {
display_scale = scale;
@@ -9987,7 +9987,7 @@ test "decor is read from the regions, each pane's in its own group" {
defer core.deinit();
_ = try core.newShell(1, "");
try std.testing.expect(pardes.layout.splitColumn(core, 0, 1, false));
- pardes.test_api.sync(core);
+ core.sync();
const s = try core.render(core.scratch.allocator());
var g: Gui = undefined;
g.decor = .empty;
@@ -10055,7 +10055,7 @@ test "a pane on the move casts a shadow on the other panes' bodies alone, most a
try std.testing.expect(pardes.layout.splitColumn(core, 0, 1, false));
try std.testing.expect(core.executeBuiltinLine(0, "Theme acme"));
for (0..40) |_| core.update(.tick);
- pardes.test_api.sync(core);
+ core.sync();
const s = try core.render(core.scratch.allocator());
var g: Gui = undefined;
g.decor = .empty;
@@ -10100,7 +10100,7 @@ test "the selection glows round its block, on the body only, fading in over 100
defer core.deinit();
_ = try core.setTestFile(std.mem.asBytes(&@as([30][20]u8, @splat("some text on a line\n".*))));
core.settings.selection_glow = true;
- pardes.test_api.sync(core);
+ core.sync();
const s = try core.render(core.scratch.allocator());
try std.testing.expectEqual(@as(u8, 1), s.chrome.fx);
// Two rows of a selection in the body, as the core paints one.
@@ -10153,7 +10153,7 @@ test "a hovered word glows along its foot, never over the cursor, fading in over
defer core.deinit();
_ = try core.setTestFile(std.mem.asBytes(&@as([30][20]u8, @splat("some text on a line\n".*))));
core.settings.hover_glow = true;
- pardes.test_api.sync(core);
+ core.sync();
const s = try core.render(core.scratch.allocator());
try std.testing.expectEqual(@as(u8, 2), s.chrome.fx);
const body = for (s.regionList()) |region| {
@@ -10206,7 +10206,7 @@ test "occlusion shades each body's edges, inside it, never a tag, a grip or the
defer core.deinit();
_ = try core.setTestFile(std.mem.asBytes(&@as([30][20]u8, @splat("some text on a line\n".*))));
core.settings.occlusion = true;
- pardes.test_api.sync(core);
+ core.sync();
const s = try core.render(core.scratch.allocator());
try std.testing.expectEqual(@as(u8, 4), s.chrome.fx);
const body = for (s.regionList()) |region| {
@@ -10251,7 +10251,7 @@ test "a body tells its first line, and lapis's dots under it move a quarter as f
try std.testing.expect(core.executeBuiltinLine(0, "Theme lapis"));
core.settings.parallax = true;
for (0..40) |_| core.update(.tick);
- pardes.test_api.sync(core);
+ core.sync();
const s = try core.render(core.scratch.allocator());
const body = for (s.regionList()) |region| {
if (region.kind == .body) break region;