Class: Tuile::Component::TextArea::WrappedText::Row
- Inherits:
-
Object
- Object
- Tuile::Component::TextArea::WrappedText::Row
- Defined in:
- lib/tuile/component/text_area/wrapped_text.rb,
sig/tuile.rbs
Overview
One row's span, measured on both axes.
Both counts cover only the row's visible content: whitespace absorbed
at a soft wrap, and the newline ending a hard one, belong to no row. So
the next row's start may sit past this row's start + length, and an
index in that gap resolves to the earlier row (see #row_at).
Constant Summary collapse
- EMPTY =
A zero-length row;
EMPTY.with(start: n)rebases it onto an index. new(start: 0, length: 0, columns: 0)
Instance Attribute Summary collapse
-
#columns ⇒ Integer
readonly
@return — terminal cells those characters occupy.
-
#length ⇒ Integer
readonly
@return — visible characters from
start. -
#start ⇒ Integer
readonly
@return — character index into #text where the row begins.
Instance Attribute Details
#columns ⇒ Integer (readonly)
@return — terminal cells those characters occupy. Exceeds Tuile::Component::TextArea::WrappedText#width only for a single glyph too wide for a row.
49 50 51 52 53 |
# File 'lib/tuile/component/text_area/wrapped_text.rb', line 49 class Row < Data.define(:start, :length, :columns) # A zero-length row; `EMPTY.with(start: n)` rebases it onto an index. # @return [Row] EMPTY = new(start: 0, length: 0, columns: 0) end |
#length ⇒ Integer (readonly)
@return — visible characters from start.
49 50 51 52 53 |
# File 'lib/tuile/component/text_area/wrapped_text.rb', line 49 class Row < Data.define(:start, :length, :columns) # A zero-length row; `EMPTY.with(start: n)` rebases it onto an index. # @return [Row] EMPTY = new(start: 0, length: 0, columns: 0) end |
#start ⇒ Integer (readonly)
@return — character index into Tuile::Component::TextArea::WrappedText#text where the row begins.
49 50 51 52 53 |
# File 'lib/tuile/component/text_area/wrapped_text.rb', line 49 class Row < Data.define(:start, :length, :columns) # A zero-length row; `EMPTY.with(start: n)` rebases it onto an index. # @return [Row] EMPTY = new(start: 0, length: 0, columns: 0) end |