simvx.core.ui.folding

Code folding manager for the code editor widget.

Provides indent-based fold region detection, fold/unfold operations, and visible-line computation for folded views.

Module Contents

Classes

FoldingMixin

Mixin providing code folding for a code editor.

API

class simvx.core.ui.folding.FoldingMixin[source]

Mixin providing code folding for a code editor.

Expects the host class to have: - _lines: list[str] - _cursor_line: int - _invalidate_cache(from_line)

fold_at_line(line: int)[source]

Fold the region starting at the given line.

unfold_at_line(line: int)[source]

Unfold the region at the given line.

toggle_fold(line: int)[source]

Toggle fold state at the given line.

unfold_all()[source]

Unfold all regions.