euporie.core.widgets.formatted_text_area

Contain dpdated ANSI parsing and Formatted Text processing.

Functions

fragment_list_to_text(fragments)

Concatenate all the text parts again.

split_lines(fragments)

Take a single list of (style_str, text) tuples and yield one such list for each line.

to_filter(bool_or_filter)

Accept both booleans and Filters as input and turn it into a Filter.

to_formatted_text(value[, style, auto_convert])

Convert the given value (which can be formatted text) into a list of text fragments.

Classes

ConditionalMargin(margin, filter)

Wrapper around other Margin classes to show/hide them.

DynamicProcessor(get_processor)

Processor class that dynamically returns any Processor.

FormattedTextArea(formatted_text, *args[, ...])

Apply formatted text to a TextArea.

FormattedTextProcessor(formatted_text)

Apply formatted text to a TextArea.

NumberedDiffMargin()

Margin that displays the line numbers of a Window.

Processor()

Manipulate the fragments for a given line in a BufferControl.

TextArea([text, multiline, password, lexer, ...])

A simple input field.

Transformation(fragments[, ...])

Transformation result, as returned by Processor.apply_transformation().

class euporie.core.widgets.formatted_text_area.FormattedTextArea(formatted_text: AnyFormattedText, *args: Any, line_numbers: FilterOrBool = False, **kwargs: Any)

Bases: prompt_toolkit.widgets.base.TextArea

Apply formatted text to a TextArea.

property accept_handler: Optional[Callable[[prompt_toolkit.buffer.Buffer], bool]]

The accept handler. Called when the user accepts the input.

property document: prompt_toolkit.document.Document

The Buffer document (text + cursor position).

property formatted_text: StyleAndTextTuples

The formatted text.

get_processor() euporie.core.widgets.formatted_text_area.FormattedTextProcessor

Generate a processor for the formatted text.

property text: str

The Buffer text.

class euporie.core.widgets.formatted_text_area.FormattedTextProcessor(formatted_text: StyleAndTextTuples)

Bases: prompt_toolkit.layout.processors.Processor

Apply formatted text to a TextArea.

apply_transformation(transformation_input: TransformationInput) Transformation

Apply text formatting to a line in a buffer.