mirror of
https://github.com/sharkdp/bat.git
synced 2025-09-15 01:32:25 +01:00
HighlightingAssets: Encapsulate syntax_set behind a getter
Since we only modify `pub(crate)` items, the stable bat-as-a-library API is not affected. This takes us one step closer to making SyntaxSet lazy-loaded, which in turn takes us one step closer to solving #951.
This commit is contained in:
@@ -174,7 +174,7 @@ impl<'a> InteractivePrinter<'a> {
|
||||
let syntax = match assets.get_syntax(config.language, input, &config.syntax_mapping) {
|
||||
Ok(syntax) => syntax,
|
||||
Err(Error(ErrorKind::UndetectedSyntax(_), _)) => {
|
||||
assets.syntax_set.find_syntax_plain_text()
|
||||
assets.get_syntax_set().find_syntax_plain_text()
|
||||
}
|
||||
Err(e) => return Err(e),
|
||||
};
|
||||
@@ -192,7 +192,7 @@ impl<'a> InteractivePrinter<'a> {
|
||||
#[cfg(feature = "git")]
|
||||
line_changes,
|
||||
highlighter,
|
||||
syntax_set: &assets.syntax_set,
|
||||
syntax_set: assets.get_syntax_set(),
|
||||
background_color_highlight,
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user