euporie.core.widgets.formatted_text_area.TextArea
- class euporie.core.widgets.formatted_text_area.TextArea(text: str = '', multiline: FilterOrBool = True, password: FilterOrBool = False, lexer: Lexer | None = None, auto_suggest: AutoSuggest | None = None, completer: Completer | None = None, complete_while_typing: FilterOrBool = True, validator: Validator | None = None, accept_handler: BufferAcceptHandler | None = None, history: History | None = None, focusable: FilterOrBool = True, focus_on_click: FilterOrBool = False, wrap_lines: FilterOrBool = True, read_only: FilterOrBool = False, width: AnyDimension = None, height: AnyDimension = None, dont_extend_height: FilterOrBool = False, dont_extend_width: FilterOrBool = False, line_numbers: bool = False, get_line_prefix: GetLinePrefixCallable | None = None, scrollbar: bool = False, style: str = '', search_field: SearchToolbar | None = None, preview_search: FilterOrBool = True, prompt: AnyFormattedText = '', input_processors: list[Processor] | None = None, name: str = '')
A simple input field.
This is a higher level abstraction on top of several other classes with sane defaults.
This widget does have the most common options, but it does not intend to cover every single use case. For more configurations options, you can always build a text area manually, using a
Buffer,BufferControlandWindow.Buffer attributes:
- Parameters:
text – The initial text.
multiline – If True, allow multiline input.
completer –
Completerinstance for auto completion.complete_while_typing – Boolean.
accept_handler – Called when Enter is pressed (This should be a callable that takes a buffer as input).
history –
Historyinstance.auto_suggest –
AutoSuggestinstance for input suggestions.
BufferControl attributes:
- Parameters:
password – When True, display using asterisks.
focusable – When True, allow this widget to receive the focus.
focus_on_click – When True, focus after mouse click.
input_processors – None or a list of
Processorobjects.validator – None or a
Validatorobject.
Window attributes:
- Parameters:
lexer –
Lexerinstance for syntax highlighting.wrap_lines – When True, don’t scroll horizontally, but wrap lines.
width – Window width. (
Dimensionobject.)height – Window height. (
Dimensionobject.)scrollbar – When True, display a scroll bar.
style – A style string.
dont_extend_width – When True, don’t take up more width then the preferred width reported by the control.
dont_extend_height – When True, don’t take up more width then the preferred height reported by the control.
get_line_prefix – None or a callable that returns formatted text to be inserted before a line. It takes a line number (int) and a wrap_count and returns formatted text. This can be used for implementation of line continuations, things like Vim “breakindent” and so on.
Other attributes:
- Parameters:
search_field – An optional SearchToolbar object.