euporie.core.processors

Buffer processors.

Functions

explode_text_fragments(fragments)

Turn a list of (style_str, text) tuples into another list where each string is exactly one character.

get_cwidth(string)

Return width of a string.

Classes

AppendAutoSuggestion([style])

Append the auto suggestion to the input.

AppendLineAutoSuggestion([style])

Append the auto suggestion to the current line of the input.

CursorProcessor(get_cursor_position[, char, ...])

Show a mouse cursor.

Point(x, y)

Processor()

Manipulate the fragments for a given line in a BufferControl.

ShowTrailingWhiteSpaceProcessor([char, style])

Make trailing whitespace visible.

Transformation(fragments[, ...])

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

class euporie.core.processors.AppendLineAutoSuggestion(style: str = 'class:auto-suggestion')

Bases: prompt_toolkit.layout.processors.AppendAutoSuggestion

Append the auto suggestion to the current line of the input.

apply_transformation(ti: TransformationInput) Transformation

Inert fragments at the end of the current line.

class euporie.core.processors.CursorProcessor(get_cursor_position: Callable[[], Point], char: str = '🮰', style: str = 'class:mouse')

Bases: prompt_toolkit.layout.processors.Processor

Show a mouse cursor.

apply_transformation(ti: TransformationInput) Transformation

Replace character at the cursor position.

class euporie.core.processors.ShowTrailingWhiteSpaceProcessor(char: str = '·', style: str = 'class:trailing-whitespace')

Bases: prompt_toolkit.layout.processors.Processor

Make trailing whitespace visible.

apply_transformation(ti: TransformationInput) Transformation

Walk backwards through all the fragments and replace whitespace.