[−][src]Trait dialect::Theme
A trait for defining syntax highlighting themes.
Required methods
fn default_style(&self) -> ResolvedStyle
The style for unhighlighted text. To understand why this must be a fully resolved style, consider the following example:
default_style
returns aStyle
which omits a foreground colour - at some point a highlighter returns aHighlightedSpan
without a highlight group- when
render
is called, what is the foreground colour of this unhighlighted HighlightedSpan?
To prevent situations like this, default_style
acts as a fallback for all cases by
forcing the implementor to define all of the style’s fields.
fn style(&self, group: HighlightGroup) -> Style
Provides a mapping from HighlightGroup
s to Style
s. As HighlightGroup
s contain a
variant for unhighlighted text, this thereby defines the appearance of the whole text
field.