summaryrefslogtreecommitdiff
path: root/src/DisplayWidth.zig
diff options
context:
space:
mode:
authorGravatar Michael Chaten2025-09-13 08:38:24 -0700
committerGravatar Michael Chaten2025-09-14 01:48:41 -0700
commita3b5e884b12fdaa341010ef41bb9382fa0cd89f8 (patch)
tree8bdd22c1c54da0b56ef6b9fe0dc4c2ca667b71a3 /src/DisplayWidth.zig
parentUpdate build to 0.15.0 (diff)
downloadzg-a3b5e884b12fdaa341010ef41bb9382fa0cd89f8.tar.gz
zg-a3b5e884b12fdaa341010ef41bb9382fa0cd89f8.tar.xz
zg-a3b5e884b12fdaa341010ef41bb9382fa0cd89f8.zip
Update codebase to Zig 0.15.1.
Removes compression support
Diffstat (limited to 'src/DisplayWidth.zig')
-rw-r--r--src/DisplayWidth.zig8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/DisplayWidth.zig b/src/DisplayWidth.zig
index 3da2d24..82b2649 100644
--- a/src/DisplayWidth.zig
+++ b/src/DisplayWidth.zig
@@ -39,11 +39,9 @@ pub fn setupWithGraphemes(dw: *DisplayWidth, allocator: Allocator, graphemes: Gr
39 39
40// Sets up the DisplayWidthData, leaving the GraphemeData undefined. 40// Sets up the DisplayWidthData, leaving the GraphemeData undefined.
41pub fn setup(dw: *DisplayWidth, allocator: Allocator) Allocator.Error!void { 41pub fn setup(dw: *DisplayWidth, allocator: Allocator) Allocator.Error!void {
42 const decompressor = compress.flate.inflate.decompressor;
43 const in_bytes = @embedFile("dwp"); 42 const in_bytes = @embedFile("dwp");
44 var in_fbs = std.io.fixedBufferStream(in_bytes); 43 var in_fbs = std.io.fixedBufferStream(in_bytes);
45 var in_decomp = decompressor(.raw, in_fbs.reader()); 44 var reader = in_fbs.reader();
46 var reader = in_decomp.reader();
47 45
48 const endian = builtin.cpu.arch.endian(); 46 const endian = builtin.cpu.arch.endian();
49 47
@@ -400,7 +398,7 @@ pub fn wrap(
400 columns: usize, 398 columns: usize,
401 threshold: usize, 399 threshold: usize,
402) ![]u8 { 400) ![]u8 {
403 var result = ArrayList(u8).init(allocator); 401 var result = std.array_list.Managed(u8).init(allocator);
404 defer result.deinit(); 402 defer result.deinit();
405 403
406 var line_iter = mem.tokenizeAny(u8, str, "\r\n"); 404 var line_iter = mem.tokenizeAny(u8, str, "\r\n");
@@ -460,8 +458,6 @@ test "allocation test" {
460const std = @import("std"); 458const std = @import("std");
461const builtin = @import("builtin"); 459const builtin = @import("builtin");
462const options = @import("options"); 460const options = @import("options");
463const ArrayList = std.ArrayList;
464const compress = std.compress;
465const mem = std.mem; 461const mem = std.mem;
466const Allocator = mem.Allocator; 462const Allocator = mem.Allocator;
467const simd = std.simd; 463const simd = std.simd;