summaryrefslogtreecommitdiff
path: root/src/Output.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-09-27 23:06:11 -0300
committerGabriel Schneider <[email protected]>2026-10-01 00:12:14 -0300
commit95a3a1bb822e583988bfe0f312d0ef219b27a454 (patch)
tree95306e8d3f36f8af05b3ea919f6cdef1e94a028b /src/Output.zig
parentc8f0c25a854b8e169db08a84d1fdcd915a70aaa0 (diff)
downloadpardes-95a3a1bb822e583988bfe0f312d0ef219b27a454.tar.gz
pardes-95a3a1bb822e583988bfe0f312d0ef219b27a454.zip
Give a pane's body its own Text holding the cursor, selections, mode and undo
acme keeps what edits a text in its Text (dat.h:171-190) and the window holds a body and a tag of that type. The cursor, the selections, the modal state and the edit-buffer undo move off Pane into Text.zig, Pane holds them as its body, and the edit and normal-mode operations take the Text they edit. Nothing changes in behaviour; this is the step that lets the tag become a second Text. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/Output.zig')
-rw-r--r--src/Output.zig22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/Output.zig b/src/Output.zig
index 6df2fd34..6e1765a7 100644
--- a/src/Output.zig
+++ b/src/Output.zig
@@ -402,7 +402,7 @@ pub fn open(p: *Pardes, id: usize, dir: []const u8, from: Origin, arg: []const u
errdefer p.gpa.destroy(history);
const pane = try p.newDocPane(id);
pane.file = .{ .path = path, .content = content, .output = out, .history = history };
- pane.cur_pinned = true;
+ pane.body.cur_pinned = true;
return pane;
}
@@ -737,20 +737,20 @@ pub fn openErrors(p: *Pardes, id: usize, content: []u8) !void {
pub fn resetBody(p: *Pardes, pane: *Pane) void {
pane.file.?.scroll = 0;
- pane.cur_row = 0;
- pane.cur_col = 0;
- pane.cur_pinned = true;
+ pane.body.cur_row = 0;
+ pane.body.cur_col = 0;
+ pane.body.cur_pinned = true;
pane.hscroll = 0;
pane.wrap_n = 0;
- pane.msel = .{};
- pane.vsel = .{};
- pane.nsel = 0;
+ pane.body.msel = .{};
+ pane.body.vsel = .{};
+ pane.body.nsel = 0;
pane.nsel_snap = 0;
- pane.select = false;
+ pane.body.select = false;
pane.sel = @splat(.{});
- pane.sticky_col = -1;
- pane.append_at = null;
- pane.normal.clear();
+ pane.body.sticky_col = -1;
+ pane.body.append_at = null;
+ pane.body.normal.clear();
pane.look_at = null;
if (p.look_hover_wait) |wait| if (wait.serial == pane.serial) {
p.look_hover_wait = null;