-
-
Notifications
You must be signed in to change notification settings - Fork 16
Open
Description
When using arborium with ratatui, you can't use spans_to_ansi because ratatui wants structured Line<'_> with Span objects that have Style attached - it does its own terminal rendering.
This means users need to reimplement the span deduplication and overlap handling logic that already exists in spans_to_themed / spans_to_ansi.
A small arborium-ratatui adapter crate could provide:
pub fn highlight_to_lines(
highlighter: &mut Highlighter,
theme: &Theme,
language: &str,
source: &str,
) -> Vec<Line<'static>>This would handle converting arborium's themed spans to ratatui's Line/Span types with proper Style mapping, keeping the deduplication logic in one place.
Context: Implemented this manually in dibs-cli and initially got it wrong (text duplication from overlapping spans) before realizing I needed the event-based stack algorithm from spans_to_ansi.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels