╭ changed ────────╮ │src/ui/widget.zig│ ╰─────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭────────────────────────────────────────╮ │20 stack: wgt.Stack(Widget), │ │21 flow_box: FlowBox, │ │22 flow_box_scroll: FlowBox.Scroll,│ │23 - tag_flow: TagFlow, │ │23 + word_flow: WordFlow, │ │24 spacer: Spacer, │ │25 center: Center, │ │26 section_label: SectionLabel, │ ╰────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────╮ │457 // available width, like words in a paragraph. unlike FlowBox there is no cell│ │458 // grid: each item is as wide as its text. selection movement is driven by the│ │459 // owning view via indexOfFocusId/verticalNeighbor. │ │460 -pub const TagFlow = struct { │ │460 +pub const WordFlow = struct { │ │461 focus: *Focus, │ │462 grid: ?Grid, │ │463 text_boxes: std.ArrayList(wgt.TextBox), │ ╰───────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────╮ │469 │ │470 pub const Item = struct { text: []const u8, link: []const u8 = "" };│ │471 │ │472 - pub fn init(allocator: std.mem.Allocator) !TagFlow { │ │472 + pub fn init(allocator: std.mem.Allocator) !WordFlow { │ │473 return .{ │ │474 .focus = try Focus.create(allocator, .container), │ │475 .grid = null, │ ╰─────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────╮ │479 }; │ │480 } │ │481 │ │482 - pub fn deinit(self: *TagFlow, allocator: std.mem.Allocator) void { │ │482 + pub fn deinit(self: *WordFlow, allocator: std.mem.Allocator) void {│ │483 self.focus.destroy(allocator); │ │484 if (self.grid) |*grid| { │ │485 grid.deinit(); │ ╰────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────╮ │493 │ │494 // the text box copies the item text; links are copied into the arena, so the │ │495 // caller's slices needn't outlive this call. │ │496 - pub fn setItems(self: *TagFlow, allocator: std.mem.Allocator, items: []const Item) !void { │ │496 + pub fn setItems(self: *WordFlow, allocator: std.mem.Allocator, items: []const Item) !void {│ │497 for (self.text_boxes.items) |*tb| tb.deinit(allocator); │ │498 self.text_boxes.clearAndFree(allocator); │ │499 │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │520 } │ │521 } │ │522 │ │523 - pub fn build(self: *TagFlow, allocator: std.mem.Allocator, constraint: layout.Constraint, root_focus: *Focus) !void { │ │523 + pub fn build(self: *WordFlow, allocator: std.mem.Allocator, constraint: layout.Constraint, root_focus: *Focus) !void {│ │524 self.clearGrid(); │ │525 self.focus.clear(); │ │526 │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │569 self.grid = grid; │ │570 } │ │571 │ │572 - pub fn input(self: *TagFlow, allocator: std.mem.Allocator, key: Key, root_focus: *Focus) !void { │ │572 + pub fn input(self: *WordFlow, allocator: std.mem.Allocator, key: Key, root_focus: *Focus) !void {│ │573 _ = self; │ │574 _ = allocator; │ │575 _ = key; │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────╮ │576 _ = root_focus; │ │577 } │ │578 │ │579 - pub fn clearGrid(self: *TagFlow) void { │ │579 + pub fn clearGrid(self: *WordFlow) void {│ │580 if (self.grid) |*grid| { │ │581 grid.deinit(); │ │582 self.grid = null; │ ╰─────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────╮ │584 for (self.text_boxes.items) |*tb| tb.clearGrid();│ │585 } │ │586 │ │587 - pub fn getGrid(self: TagFlow) ?Grid { │ │587 + pub fn getGrid(self: WordFlow) ?Grid { │ │588 return self.grid; │ │589 } │ │590 │ ╰──────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────╮ │591 - pub fn getFocus(self: *TagFlow) *Focus { │ │591 + pub fn getFocus(self: *WordFlow) *Focus {│ │592 return self.focus; │ │593 } │ │594 │ ╰──────────────────────────────────────────────────╯ ╭──────╮ │next →│ ╰──────╯