Bubbles::Viewport
Constants
DEFAULT_HORIZONTAL_STEP = 6
NoGutter = ->(_ctx : GutterContext) do
""
end
Constructors
new(*opts : Option) : Model
SourceClass methods
default_key_map
Sourcemake_highlight_ranges(highlights : Array(HighlightInfo), line : Int32, style : Lipgloss::Style) : Array(Lipgloss::Range)
make_highlight_ranges returns lipgloss ranges for the given line.
parse_matches converts the given matches into highlight ranges.
Assumptions:
- matches are measured in bytes, e.g. what regex.FindAllStringIndex would return
- matches were made against the given content
- matches are in order
- matches do not overlap
- content is line terminated with \n only
We'll then convert the ranges into HighlightInfos, which hold the starting line and the grapheme positions.