build: update to libvaxis with uucode support

This commit is contained in:
CJ van den Berg 2025-11-23 21:45:51 +01:00
parent 765a5d2dc7
commit b2b34e4710
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9
9 changed files with 21 additions and 35 deletions

View file

@ -181,7 +181,7 @@ pub fn putstr(self: *Plane, text: []const u8) !usize {
var result: usize = 0;
const height = self.window.height;
const width = self.window.width;
var iter = self.window.unicode.graphemeIterator(text);
var iter = vaxis.unicode.graphemeIterator(text);
while (iter.next()) |grapheme| {
const s = grapheme.bytes(text);
if (std.mem.eql(u8, s, "\n")) {
@ -207,7 +207,7 @@ pub fn putstr(self: *Plane, text: []const u8) !usize {
pub fn putstr_unicode(self: *Plane, text: []const u8) !usize {
var result: usize = 0;
var iter = self.window.unicode.graphemeIterator(text);
var iter = vaxis.unicode.graphemeIterator(text);
while (iter.next()) |grapheme| {
const s_ = grapheme.bytes(text);
const s = switch (s_[0]) {
@ -443,7 +443,7 @@ pub fn egc_length(self: *const Plane, egcs: []const u8, colcount: *c_int, abs_co
colcount.* = @intCast(tab_width - (abs_col % tab_width));
return 1;
}
var iter = self.window.unicode.graphemeIterator(egcs);
var iter = vaxis.unicode.graphemeIterator(egcs);
const grapheme = iter.next() orelse {
colcount.* = 1;
return 1;
@ -469,8 +469,8 @@ pub fn egc_chunk_width(self: *const Plane, chunk_: []const u8, abs_col_: usize,
return colcount;
}
pub fn egc_last(self: *const Plane, egcs: []const u8) []const u8 {
var iter = self.window.unicode.graphemeIterator(egcs);
pub fn egc_last(egcs: []const u8) []const u8 {
var iter = vaxis.unicode.graphemeIterator(egcs);
var last: []const u8 = egcs[0..0];
while (iter.next()) |grapheme| last = grapheme.bytes(egcs);
return last;
@ -493,9 +493,8 @@ pub fn metrics(self: *const Plane, tab_width: usize) Buffer.Metrics {
}.f,
.tab_width = tab_width,
.egc_last = struct {
fn f(self_: Buffer.Metrics, egcs: []const u8) []const u8 {
const plane: *const Plane = @ptrCast(@alignCast(self_.ctx));
return plane.egc_last(egcs);
fn f(_: Buffer.Metrics, egcs: []const u8) []const u8 {
return egc_last(egcs);
}
}.f,
};