summaryrefslogtreecommitdiffstats
path: root/src/ui
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/syntax_text.rs9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/ui/syntax_text.rs b/src/ui/syntax_text.rs
index 70283067..5c6271aa 100644
--- a/src/ui/syntax_text.rs
+++ b/src/ui/syntax_text.rs
@@ -118,7 +118,14 @@ impl SyntaxText {
))?;
for (number, line) in text.lines().enumerate() {
- let ops = state.parse_line(line, &SYNTAX_SET);
+ let ops = state
+ .parse_line(line, &SYNTAX_SET)
+ .map_err(|e| {
+ log::error!("syntax error: {:?}", e);
+ asyncgit::Error::Generic(
+ "syntax error".to_string(),
+ )
+ })?;
let iter = RangedHighlightIterator::new(
&mut highlight_state,
&ops[..],