Add syntaxes and themes method

This commit is contained in:
sharkdp authored and David Peter committed 2020-04-22 23:55:28 +02:00
1 parent cba9df746e
commit 53a973e9dd
4 files changed
+30 -3

No files matched your search

+9
View File
@@ -2,6 +2,7 @@ use std::ffi::OsStr;
use std::io::Read;
use console::Term;
use syntect::parsing::SyntaxReference;
use crate::{
assets::HighlightingAssets,
@@ -201,6 +202,14 @@ impl<'a> PrettyPrinter<'a> {
self
}
pub fn themes(&self) -> impl Iterator<Item = &str> {
self.assets.themes()
}
pub fn syntaxes(&self) -> impl Iterator<Item = &SyntaxReference> {
self.assets.syntaxes().iter()
}
/// Pretty-print all specified inputs. This method will "use" all stored inputs.
/// If you want to call 'print' multiple times, you have to call the appropriate
/// input_* methods again.