window(print): use const Segment

This commit is contained in:
Tim Culverhouse 2024-05-03 13:58:23 -05:00
parent 6abfd8fc3f
commit fa7d94f3df

View file

@ -269,7 +269,7 @@ pub const PrintResult = struct {
/// prints segments to the window. returns true if the text overflowed with the /// prints segments to the window. returns true if the text overflowed with the
/// given wrap strategy and size. /// given wrap strategy and size.
pub fn print(self: Window, segments: []Segment, opts: PrintOptions) !PrintResult { pub fn print(self: Window, segments: []const Segment, opts: PrintOptions) !PrintResult {
var row = opts.row_offset; var row = opts.row_offset;
switch (opts.wrap) { switch (opts.wrap) {
.grapheme => { .grapheme => {
@ -439,7 +439,7 @@ pub fn print(self: Window, segments: []Segment, opts: PrintOptions) !PrintResult
} }
/// Deprecated. use print instead /// Deprecated. use print instead
pub fn wrap(self: Window, segments: []Segment) !void { pub fn wrap(self: Window, segments: []const Segment) !void {
_ = try self.print(segments, .{ .wrap = .word }); _ = try self.print(segments, .{ .wrap = .word });
} }