Skip to content

Commit ed1394c

Browse files
committed
Fix two thinko bugs in WrappableBuffer
1 parent 8fe3ecf commit ed1394c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/Terminal/Widgets/WrappableBuffer.rakumod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ does Terminal::Widgets::SpanBuffer {
100100

101101
# Make sure all LineGroups have wrapped lines cached,
102102
# then set y-max equal to total of all wrapped lines
103-
%!wrapped-lines{.id} = self.wrap-lines(.id) for @!line-groups;
103+
%!wrapped-lines{.id} //= self.wrap-lines(.id) for @!line-groups;
104104
self.set-y-max(%!wrapped-lines.values.map(*.elems).sum);
105105
}
106106
}
@@ -112,7 +112,7 @@ does Terminal::Widgets::SpanBuffer {
112112
#| at a given $pos, defaulting to appending at the end
113113
multi method insert-line-group(TextContent:D $content,
114114
UInt:D $pos = @!line-groups.elems) {
115-
self.add-line-group(Terminal::Widgets::LineGroup.new(:$content), $pos)
115+
self.insert-line-group(Terminal::Widgets::LineGroup.new(:$content), $pos)
116116
}
117117

118118
#| Insert a single LineGroup into the buffer at a given $pos, defaulting

0 commit comments

Comments
 (0)