From 5c3baccaf899618ba93abdb136d1183456d13bbb Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Tue, 10 Sep 2024 23:37:44 +0200 Subject: [PATCH] source: report highlighting errors and delay caching Missing Text::VimColor went unnoticed but resulted in empty cache files. --- source.plp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source.plp b/source.plp index 7385218..b0b5daa 100644 --- a/source.plp +++ b/source.plp @@ -87,8 +87,6 @@ else { exit; } -e or mkdir for $cachefile =~ s{[^/]+\z}{}r; # dirname - open my $cache, '>', $cachefile - or Alert("Could not save cache", "Opening $cachefile failed: $!");; if (my $hl = eval { $size < 32_768 or die 'large files take too long to parse'; @@ -110,6 +108,8 @@ else { Todo => 'em', PreProc => 'strong', ); + open my $cache, '>', $cachefile + or Alert("Could not save cache", "Opening $cachefile failed: $!");; say '
';
 		foreach (@{$hl}) {
@@ -138,6 +138,7 @@ else {
 		say '
'; } else { + warn $@ if $@; say '
';
 		print EscapeHTML(decode_utf8(ReadFile($path)));
 		say '
'; -- 2.30.2