summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/DisplayWidth.zig8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/DisplayWidth.zig b/src/DisplayWidth.zig
index 4c63be4..3da2d24 100644
--- a/src/DisplayWidth.zig
+++ b/src/DisplayWidth.zig
@@ -31,8 +31,14 @@ pub fn initWithGraphemes(allocator: Allocator, graphemes: Graphemes) Allocator.E
31 return dw; 31 return dw;
32} 32}
33 33
34pub fn setupWithGraphemes(dw: *DisplayWidth, allocator: Allocator, graphemes: Graphemes) Allocator.Error!void {
35 try dw.setup(allocator);
36 dw.graphemes = graphemes;
37 dw.owns_graphemes = false;
38}
39
34// Sets up the DisplayWidthData, leaving the GraphemeData undefined. 40// Sets up the DisplayWidthData, leaving the GraphemeData undefined.
35fn setup(dw: *DisplayWidth, allocator: Allocator) Allocator.Error!void { 41pub fn setup(dw: *DisplayWidth, allocator: Allocator) Allocator.Error!void {
36 const decompressor = compress.flate.inflate.decompressor; 42 const decompressor = compress.flate.inflate.decompressor;
37 const in_bytes = @embedFile("dwp"); 43 const in_bytes = @embedFile("dwp");
38 var in_fbs = std.io.fixedBufferStream(in_bytes); 44 var in_fbs = std.io.fixedBufferStream(in_bytes);