1
0
mirror of https://github.com/sharkdp/bat.git synced 2025-09-03 03:42:26 +01:00

Adds a little logic to main to get other mappings from config

This commit is contained in:
Alex Novak
2020-05-29 21:53:31 -04:00
committed by David Peter
parent 92e93682c6
commit 48b4a6a906
2 changed files with 36 additions and 1 deletions

View File

@@ -59,6 +59,10 @@ impl<'a> SyntaxMapping<'a> {
Ok(())
}
pub fn mappings(&self) -> &Vec<(GlobMatcher, MappingTarget<'a>)> {
&self.mappings
}
pub(crate) fn get_syntax_for(&self, path: impl AsRef<Path>) -> Option<MappingTarget<'a>> {
let candidate = Candidate::new(path.as_ref());
let canddidate_filename = path.as_ref().file_name().map(Candidate::new);