class

Term2::Components::TextArea

Inherits Term2::Model < Reference < Object

Constructors

new(id : String = "")
Source

Class methods

default_key_map
Source

Instance methods

blur

Blur (unfocus) this model's zone.

Source
char_limit
Source
char_limit=(char_limit : Int32)
Source
cursor
Source
cursor=(cursor : Cursor)
Source
cursor_col
Source
cursor_col=(cursor_col : Int32)
Source
cursor_line
Source
cursor_line=(cursor_line : Int32)
Source
delete_char(lines : Array(String))
Source
delete_word_left(lines : Array(String))
Source
end_of_buffer_char

End-of-buffer marker, rendered on otherwise blank lines. Allows ANSI styling like the Go textarea's Style.EndOfBuffer.

Source
end_of_buffer_char=(end_of_buffer_char : String)

End-of-buffer marker, rendered on otherwise blank lines. Allows ANSI styling like the Go textarea's Style.EndOfBuffer.

Source
focus

Focus this model's zone.

Source
focused?

Whether this model is currently focused.

Source
handle_key(msg : KeyMsg)
Source
height
Source
height=(h : Int32)
Source
id

Properties matching Go implementation

Source
id=(id : String)

Properties matching Go implementation

Source
insert_char(lines : Array(String), char : String)
Source
insert_newline(lines : Array(String))
Source
insert_string(str : String)
Source
key_map
Source
key_map=(key_map : KeyMap)
Source
line_info
Source
max_height
Source
max_height=(max_height : Int32)
Source
max_width
Source
max_width=(max_width : Int32)
Source
placeholder
Source
placeholder=(placeholder : String)
Source
prompt
Source
prompt=(prompt : String)
Source
reset
Source
scroll_to_cursor
Source
set_height(h : Int32)
Source
set_width(w : Int32)

Alias for Go-style setters

Source
show_line_numbers=(show_line_numbers : Bool)
Source
show_line_numbers?
Source
style

Styles (Placeholder for future expansion)

Source
style=(style : Style)

Styles (Placeholder for future expansion)

Source
update(msg : Msg) : Tuple(TextArea, Cmd)

Update logic

Source
update_viewport
Source
value
Source
value=(text : String)
Source
view

View renders the program's UI, which is just a string. The view is rendered after every Update.

Source
viewport
Source
viewport=(viewport : Viewport)
Source
width

Getters/Setters for width/height that update viewport

Source
width=(w : Int32)
Source

Nested types