summaryrefslogtreecommitdiff
path: root/src/Core.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-05 20:53:34 -0300
committerGabriel Schneider <[email protected]>2026-11-05 22:07:55 -0300
commit5b135dc60d4e9f77be0a4f883439f3200ac30d30 (patch)
treeb7a38b6c48eed83e0dd5f6e93110886bd4b02173 /src/Core.zig
parent80d47cd246f37356fd2e705495936f6546613e29 (diff)
downloadpardes-5b135dc60d4e9f77be0a4f883439f3200ac30d30.tar.gz
pardes-5b135dc60d4e9f77be0a4f883439f3200ac30d30.zip
fields #40, a key prefix is one enum: leader_on and ctrl_w_pending, never both, are the session's prefix (none, leader or window); handleKey's three writes of both are one each, and the reads say p.prefix == .leader (Messages.zig, normal.zig, pdf_view.zig, config.zig's test; gui.zig's leader chip on a test step); views.zig's per-view fields name prefix; a dump written before this change loads it as the default once: an Upgrade or Restore from it comes back with no prefix pending, and the wire's semantics change; gates on tui: core-test 960/960, behaviour-test 238/238, pane-test 171/172 (1 skipped), snap all 108 scripts ok; gui unit-test 1518/1519 (1 skipped)
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
Diffstat (limited to 'src/Core.zig')
-rw-r--r--src/Core.zig9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/Core.zig b/src/Core.zig
index 9219cc0e..c5665cb5 100644
--- a/src/Core.zig
+++ b/src/Core.zig
@@ -246,7 +246,6 @@ look_hover_refused: ?look.LookHoverWait = null,
look_hover_preview: ?look.LookHoverPreview = null,
pdf_hover_preview: if (pdf_enabled) ?look.PdfWordPreview else void = if (pdf_enabled) null else {},
wheel_guard: u8 = 0,
-ctrl_w_pending: bool = false,
/// While a key is replayed across the ranges (normal.replaySels): which
/// range this pass is, in document order, how many there are, and
/// whether this is the first pass; outside a replay, the one range and
@@ -258,7 +257,9 @@ multi_count: usize = 1,
/// The register the running normal command names (`"<reg>`); 0 for the
/// default one.
register: u21 = 0,
-leader_on: bool = false,
+/// A key that waits for the next: the leader (SPC) or the window prefix
+/// (Ctrl-w), one at a time.
+prefix: enum { none, leader, window } = .none,
/// Window mode's outlined pane (layout.windowKey); null outside it.
window_pick: ?usize = null,
leader_keys: [4]u8 = undefined,
@@ -2408,11 +2409,11 @@ test "TreeContext tag style preserves message rows and its opt-out survives rest
try std.testing.expect(band.viewport.w < r.w - config.GUTTER);
try std.testing.expectEqualStrings("!", band.cells[layout.tagCapacity(p, band.viewport.w) - 2].grapheme());
pane.msg_len = 0;
- p.leader_on = true;
+ p.prefix = .leader;
p.sync();
_ = try p.render(p.scratch.allocator());
try std.testing.expectEqual(full_height, p.surface.body_layers[0].viewport.h);
- p.leader_on = false;
+ p.prefix = .none;
try std.testing.expect(p.executeBuiltinLine(0, "TreeContextTagStyle"));
p.sync();
_ = try p.render(p.scratch.allocator());