Class: Tuile::Component::TextArea::WrappedText::Row

Inherits:
Object
  • Object
show all
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.

Returns:

new(start: 0, length: 0, columns: 0)

Instance Attribute Summary collapse

Instance Attribute Details

#columnsInteger (readonly)

@return — terminal cells those characters occupy. Exceeds Tuile::Component::TextArea::WrappedText#width only for a single glyph too wide for a row.

Returns:

  • (Integer)


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

#lengthInteger (readonly)

@return — visible characters from start.

Returns:

  • (Integer)


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

#startInteger (readonly)

@return — character index into Tuile::Component::TextArea::WrappedText#text where the row begins.

Returns:

  • (Integer)


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