Merge branch 'master' into zig-0.15

This commit is contained in:
CJ van den Berg 2025-09-12 01:05:35 +02:00
commit 8903ca86b1
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9
7 changed files with 66 additions and 5 deletions

View file

@ -28,8 +28,12 @@ pub inline fn right_of(self: Self, other: Self) bool {
}
pub fn clamp_to_buffer(self: *Self, root: Buffer.Root, metrics: Metrics) void {
self.row = @min(self.row, root.lines() - 1);
self.col = @min(self.col, root.line_width(self.row, metrics) catch 0);
if (self.row > root.lines() - 1) {
self.row = root.lines() - 1;
self.col = root.line_width(self.row, metrics) catch 0;
} else {
self.col = @min(self.col, root.line_width(self.row, metrics) catch 0);
}
}
fn follow_target(self: *Self, root: Buffer.Root, metrics: Metrics) void {