euporie.core.processors

Buffer processors.

Functions

cast(typ, val)

Cast a value to a type.

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.

DiagnosticProcessor(report[, style])

Highlight diagnostics.

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: 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: Processor

Show a mouse cursor.

apply_transformation(ti: TransformationInput) Transformation

Replace character at the cursor position.

class euporie.core.processors.DiagnosticProcessor(report: Report | Callable[[], Report], style: str = 'underline')

Bases: Processor

Highlight diagnostics.

apply_transformation(ti: TransformationInput) Transformation

Underline the text ranges relating to diagnostics in the report.

property report: Report

Return the current diagnostics report.

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

Bases: Processor

Make trailing whitespace visible.

apply_transformation(ti: TransformationInput) Transformation

Walk backwards through all the fragments and replace whitespace.