refactor(Buffer): remove Plane dependency in Buffer

This commit is contained in:
CJ van den Berg 2024-07-05 00:33:31 +02:00
parent a3a298f721
commit 128182a448
7 changed files with 242 additions and 216 deletions

View file

@ -16,12 +16,12 @@ pub fn from_cursor(cursor: *const Cursor) Self {
return .{ .begin = cursor.*, .end = cursor.* };
}
pub fn line_from_cursor(cursor: Cursor, root: Buffer.Root, plane: Plane) Self {
pub fn line_from_cursor(cursor: Cursor, root: Buffer.Root, mtrx: Buffer.Metrix) Self {
var begin = cursor;
var end = cursor;
begin.move_begin();
end.move_end(root, plane);
end.move_right(root, plane) catch {};
end.move_end(root, mtrx);
end.move_right(root, mtrx) catch {};
return .{ .begin = begin, .end = end };
}