From: Mischa POSLAWSKY Date: Tue, 10 Sep 2024 21:37:44 +0000 (+0200) Subject: source: report highlighting errors and delay caching X-Git-Url: http://git.shiar.net/sheet.git/commitdiff_plain/5c3baccaf899618ba93abdb136d1183456d13bbb?ds=sidebyside;hp=18402f44dfbfb0f3ab6f6069e51ac78c7e17707a source: report highlighting errors and delay caching Missing Text::VimColor went unnoticed but resulted in empty cache files. --- 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 '
';