summaryrefslogtreecommitdiffstats
path: root/src/display
diff options
context:
space:
mode:
authorCanop <cano.petrole@gmail.com>2022-01-21 22:37:33 +0100
committerCanop <cano.petrole@gmail.com>2022-01-21 22:37:33 +0100
commitd75f7580fd8cd5ce7f2564b555f161ecbfdc1dcf (patch)
tree514f432c484df4f94f40445ea70ca932af74ed3c /src/display
parentfcaf7b5cff5f038e4583d67cbe26e6f196ef7338 (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.rs3
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