diff options
author | Canop <cano.petrole@gmail.com> | 2022-01-21 22:37:33 +0100 |
---|---|---|
committer | Canop <cano.petrole@gmail.com> | 2022-01-21 22:37:33 +0100 |
commit | d75f7580fd8cd5ce7f2564b555f161ecbfdc1dcf (patch) | |
tree | 514f432c484df4f94f40445ea70ca932af74ed3c /src/display | |
parent | fcaf7b5cff5f038e4583d67cbe26e6f196ef7338 (diff) |
Fix a crash on a syntect panic on svelte file
fall back to unstyled when syntect crashes.
This uses a temporary fork, which hopefully will disappear
as soon as syntect 5 is usable.
Diffstat (limited to 'src/display')
-rw-r--r-- | src/display/displayable_tree.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/display/displayable_tree.rs b/src/display/displayable_tree.rs index 8a27aa6..be5f2db 100644 --- a/src/display/displayable_tree.rs +++ b/src/display/displayable_tree.rs @@ -106,7 +106,8 @@ impl<'a, 's, 't> DisplayableTree<'a, 's, 't> { ) -> Result<usize, termimad::Error> { Ok(if let Some(s) = line.sum { cond_bg!(count_style, self, selected, self.skin.count); - cw.queue_g_string(count_style, format!("{:>width$}", s.to_count(), width=count_len))?; + let s = s.to_count(); + cw.queue_g_string(count_style, format!("{s:>count_len$}"))?; 1 } else { count_len + 1 |