|
14 | 14 | class ROW; |
15 | 15 | class TextBuffer; |
16 | 16 |
|
| 17 | +// Because MarkKind::Output gets set only on the actually written text, |
| 18 | +// most rows will end up having at least 2 runs: The start of the line |
| 19 | +// with MarkKind::Output and the rest of the line with MarkKind::None. |
| 20 | +using RowAttributes = til::small_rle<TextAttribute, uint16_t, 2>; |
| 21 | + |
17 | 22 | enum class DelimiterClass |
18 | 23 | { |
19 | 24 | ControlChar, |
@@ -148,8 +153,8 @@ class ROW final |
148 | 153 | void ReplaceText(RowWriteState& state); |
149 | 154 | void CopyTextFrom(RowCopyTextFromState& state); |
150 | 155 |
|
151 | | - til::small_rle<TextAttribute, uint16_t, 1>& Attributes() noexcept; |
152 | | - const til::small_rle<TextAttribute, uint16_t, 1>& Attributes() const noexcept; |
| 156 | + RowAttributes& Attributes() noexcept; |
| 157 | + const RowAttributes& Attributes() const noexcept; |
153 | 158 | TextAttribute GetAttrByColumn(til::CoordType column) const; |
154 | 159 | std::vector<uint16_t> GetHyperlinks() const; |
155 | 160 | ImageSlice* SetImageSlice(ImageSlice::Pointer imageSlice) noexcept; |
@@ -297,7 +302,7 @@ class ROW final |
297 | 302 | std::span<uint16_t> _charOffsets; |
298 | 303 | // _attr is a run-length-encoded vector of TextAttribute with a decompressed |
299 | 304 | // length equal to _columnCount (= 1 TextAttribute per column). |
300 | | - til::small_rle<TextAttribute, uint16_t, 1> _attr; |
| 305 | + RowAttributes _attr; |
301 | 306 | // The width of the row in visual columns. |
302 | 307 | uint16_t _columnCount = 0; |
303 | 308 | // Stores double-width/height (DECSWL/DECDWL/DECDHL) attributes. |
|
0 commit comments