The approach I've taken here is basically a brute force approach - we reconstruct the Vec<Style, &str> from the file contents when we need it. We construct the Range<usize> manually rather than using HighlightRangeIter, because the API of HighlightRangeIter means we need to do a lot manual plumbing outselves.
CC @trishume
It's worth noting that the file never changes between the times we are rehighlighting - it's only the HTML we need to regenerate, because our only change is adding a lightcoral (#f08080) background on the currently active text.
Fixes #30
The approach I've taken here is basically a brute force approach - we reconstruct the
Vec<Style, &str>
from the file contents when we need it. We construct theRange<usize>
manually rather than usingHighlightRangeIter
, because the API ofHighlightRangeIter
means we need to do a lot manual plumbing outselves.CC @trishume
It's worth noting that the file never changes between the times we are rehighlighting - it's only the HTML we need to regenerate, because our only change is adding a
lightcoral
(#f08080
) background on the currently active text.