feat: add libvaxis renderer

This commit is contained in:
CJ van den Berg 2024-05-01 22:03:33 +02:00
parent b15fa47f30
commit 1cd3cb17ce
32 changed files with 1559 additions and 516 deletions

View file

@ -1,4 +1,5 @@
const std = @import("std");
const Plane = @import("renderer").Plane;
const Buffer = @import("Buffer.zig");
const Cursor = @import("Cursor.zig");
@ -15,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) Self {
pub fn line_from_cursor(cursor: Cursor, root: Buffer.Root, plane: Plane) Self {
var begin = cursor;
var end = cursor;
begin.move_begin();
end.move_end(root);
end.move_right(root) catch {};
end.move_end(root, plane);
end.move_right(root, plane) catch {};
return .{ .begin = begin, .end = end };
}