summaryrefslogtreecommitdiffstats
path: root/src/printer.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/printer.rs')
-rw-r--r--src/printer.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/printer.rs b/src/printer.rs
index 3d8fa9bf..41d298c6 100644
--- a/src/printer.rs
+++ b/src/printer.rs
@@ -164,7 +164,10 @@ impl<'a> InteractivePrinter<'a> {
None
} else {
// Determine the type of syntax for highlighting
- let syntax = assets.get_syntax(config.language, input, &config.syntax_mapping);
+ let syntax = assets
+ .get_syntax(config.language, input, &config.syntax_mapping)
+ .unwrap_or_else(|_| assets.syntax_set.find_syntax_plain_text());
+
Some(HighlightLines::new(syntax, theme))
};