simvx.core.ui.markers

Text marker management for the code editor widget.

Provides inline markers (error squiggles, warnings, breakpoints, bookmarks), hover tooltip state, and marker drawing routines.

Module Contents

Classes

TextMarker

MarkerMixin

Mixin providing marker management and rendering for a code editor.

Data

API

simvx.core.ui.markers.__all__

[‘TextMarker’, ‘_MARKER_COLOURS’]

class simvx.core.ui.markers.TextMarker[source]
line: int

None

col_start: int

None

col_end: int

None

type: str

‘error’

colour: tuple[float, float, float, float]

(1.0, 0.2, 0.2, 0.6)

tooltip: str = <Multiline-String>
class simvx.core.ui.markers.MarkerMixin[source]

Mixin providing marker management and rendering for a code editor.

Expects the host class to have: - _lines: list[str] - _scroll_y: float - font_size: float - show_line_numbers: bool - size (Vec2-like with .x) - queue_redraw() - get_global_rect() - get_theme() - _line_y(line_idx)

add_marker(line: int, col_start: int, col_end: int, type: str = 'error', colour: tuple[float, float, float, float] | None = None, tooltip: str = '') simvx.core.ui.markers.TextMarker[source]

Add an inline marker (error squiggle, warning, etc.).

remove_marker(marker: simvx.core.ui.markers.TextMarker)[source]

Remove a specific marker.

clear_markers(type: str | None = None)[source]

Clear all markers, or only markers of a specific type.

get_markers(line: int | None = None) list[simvx.core.ui.markers.TextMarker][source]

Get all markers, or only markers on a specific line.

set_hover_tooltip(text: str, line: int, col: int)[source]

Set a hover tooltip from LSP or other sources.