class

Term2::Components::Viewport

Inherits Term2::Model < Reference < Object

Constructors

new(width : Int32, height : Int32)
Source

Instance methods

content
Source
content=(content : String)
Source
find_longest_line_width(lines : Array(String)) : Int32
Source
goto_bottom
Source
goto_top
Source
half_page_down
Source
half_page_up
Source
height
Source
height=(height : Int32)
Source
horizontal_step

Horizontal step with clamping

Source
horizontal_step=(value : Int32)
Source
initialized
Source
initialized=(initialized : Bool)
Source
initialized?
Source
key_map

Key bindings

Source
key_map=(key_map : KeyMap)

Key bindings

Source
line_down
Source
line_up
Source
lines
Source
lines=(lines : Array(String))
Source
longest_line_width
Source
longest_line_width=(longest_line_width : Int32)
Source
max_y_offset
Source
mouse_wheel_delta
Source
mouse_wheel_delta=(mouse_wheel_delta : Int32)
Source
mouse_wheel_enabled

Additional properties from Go implementation

Source
mouse_wheel_enabled=(mouse_wheel_enabled : Bool)

Additional properties from Go implementation

Source
mouse_wheel_enabled?

Query methods

Source
page_down
Source
page_up
Source
scroll_left(n : Int32 = @horizontal_step)
Source
scroll_percent
Source
scroll_right(n : Int32 = @horizontal_step)
Source
set_initial_values
Source
set_x_offset(n : Int32)
Source
update(msg : Message) : Tuple(Viewport, Cmd)

Update is called when a message is received. Use it to inspect the message and, in response, update the model and/or send a command.

Source
view

Helper to render as a string

Source
visible_lines
Source
width
Source
width=(width : Int32)
Source
x_offset
Source
x_offset=(x_offset : Int32)
Source
y_offset
Source
y_offset=(y_offset : Int32)
Source
y_position
Source
y_position=(y_position : Int32)
Source

Nested types