Class: TuiTui::TextInput::Viewport
- Inherits:
-
Data
- Object
- Data
- TuiTui::TextInput::Viewport
- Defined in:
- lib/tui_tui/text_input.rb
Overview
The visible region of a horizontally-scrolled value: the slice to draw,
scrolled so the cursor (and the cell its block occupies) stays inside cols
display columns. Lets a long value be drawn in a narrow field without the
cursor running off the edge.
text is the visible substring, cursor_col the display columns from the
viewport's left edge to the cursor (measured from the slice, not the start
of the value), cursor_grapheme the grapheme under the cursor (nil at the
end), and start the left grapheme index (feed it to #index_at as from:).
Instance Attribute Summary collapse
-
#cursor_col ⇒ Object
readonly
Returns the value of attribute cursor_col.
-
#cursor_grapheme ⇒ Object
readonly
Returns the value of attribute cursor_grapheme.
-
#start ⇒ Object
readonly
Returns the value of attribute start.
-
#text ⇒ Object
readonly
Returns the value of attribute text.
Instance Attribute Details
#cursor_col ⇒ Object (readonly)
Returns the value of attribute cursor_col
117 118 119 |
# File 'lib/tui_tui/text_input.rb', line 117 def cursor_col @cursor_col end |
#cursor_grapheme ⇒ Object (readonly)
Returns the value of attribute cursor_grapheme
117 118 119 |
# File 'lib/tui_tui/text_input.rb', line 117 def cursor_grapheme @cursor_grapheme end |
#start ⇒ Object (readonly)
Returns the value of attribute start
117 118 119 |
# File 'lib/tui_tui/text_input.rb', line 117 def start @start end |
#text ⇒ Object (readonly)
Returns the value of attribute text
117 118 119 |
# File 'lib/tui_tui/text_input.rb', line 117 def text @text end |