summaryrefslogtreecommitdiff
path: root/src/gui
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/gui
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/gui')
-rw-r--r--src/gui/gui.zig14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/gui/gui.zig b/src/gui/gui.zig
index a11b22c7..97bbc816 100644
--- a/src/gui/gui.zig
+++ b/src/gui/gui.zig
@@ -1399,7 +1399,7 @@ test "GUI completion failure survives backlog and leaves the document unchanged"
const core = try pardes.Pardes.init(gpa, .{ .tty_only = true });
defer core.deinit();
const pane = try core.setTestFile("abc");
- pane.cur_col = 1;
+ pane.body.cur_col = 1;
core.lspRequest(core.active, .completion, "");
const id = core.lsp_wait.?.id;
var workers: LspWorkers = .{};
@@ -1426,7 +1426,7 @@ test "GUI completion failure survives backlog and leaves the document unchanged"
shell.drainQueue();
try std.testing.expect(core.lsp_wait == null);
try std.testing.expectEqualStrings("abc", pane.file.?.content);
- try std.testing.expectEqual(@as(i32, 1), pane.cur_col);
+ try std.testing.expectEqual(@as(i32, 1), pane.body.cur_col);
try std.testing.expect(shell.saw_event);
}
@@ -1611,7 +1611,7 @@ test "GUI LSP worker limit rejects before allocation and recovers after owned wo
const core = try pardes.Pardes.init(gpa, .{ .tty_only = true });
defer core.deinit();
const pane = try core.setTestFile("abc");
- pane.cur_col = 1;
+ pane.body.cur_col = 1;
var workers: LspWorkers = .{};
var gate: std.Io.Event = .unset;
var threads: [LspWorkers.capacity]?std.Thread = @splat(null);
@@ -1650,7 +1650,7 @@ test "GUI LSP worker limit rejects before allocation and recovers after owned wo
});
try std.testing.expect(core.lsp_wait == null);
try std.testing.expectEqualStrings("abc", pane.file.?.content);
- try std.testing.expectEqual(@as(i32, 1), pane.cur_col);
+ try std.testing.expectEqual(@as(i32, 1), pane.body.cur_col);
try std.testing.expect(std.mem.indexOf(u8, pane.msg[0..pane.msg_len], "WorkersBusy") != null);
try std.testing.expectEqual(@as(usize, 0), failing.alloc_index);
try std.testing.expect(!failing.has_induced_failure);
@@ -1762,8 +1762,8 @@ test "GUI worker setup failures finish matching LSP and pipe requests" {
try std.testing.expect(core.lsp_wait == null);
try std.testing.expectEqualStrings("abc", pane.file.?.content);
- pane.cur_col = 2;
- pane.vsel = .{ .active = true, .row = 0, .col = 0, .explicit = true };
+ pane.body.cur_col = 2;
+ pane.body.vsel = .{ .active = true, .row = 0, .col = 0, .explicit = true };
core.update(.{ .key = .{ .cp = '|' } });
core.update(.{ .key = .{ .cp = 't', .text = "tr a-z A-Z" } });
core.update(.{ .key = .{ .cp = pardes.Key.enter } });
@@ -3870,7 +3870,7 @@ const Shell = struct {
s.closePty(e.pane);
if (e.failure) |err| {
if (s.core.panes[e.pane]) |pane| {
- pane.mode = .normal;
+ pane.body.mode = .normal;
s.core.reportError(e.pane, "terminal reader", err);
}
} else s.core.update(.{ .eof = .{ .pane = e.pane } });