Fixes parsing of `wdiff` output
Fixes #6
Thanks for the report and the fix, I will test this on OSX, whose sed is slightly different, and then merge it.
Hmm, OSX it says:
": RE error: repetition-operator operand invalid
replace .*? to something like .* works, so it seems BSD sed doesn't implement .*? even with -E.
It might be better to replace the whole color_filter() with wdiff -w "$RED" -x "$OFF" -y "$GREEN" -z "$OFF".
Yes, I think so, too. AFAICS, only wdiff knows where the diffs start and end, and parsing the output of wdiff will fail, even with non-greedy regular expressions – you can always construct input that clashes with -] and siblings.
As a corollary it is probably necessary to remove the --filter option because it cannot be implemented reliably.
Yes, I think so, too. AFAICS, only
wdiffknows where the diffs start and end, and parsing the output ofwdiffwill fail, even with non-greedy regular expressions – you can always construct input that clashes with-]and siblings.
Or, we inject out own markers and replace those, but as you said one can always construct a clash.
As a corollary it is probably necessary to remove the
--filteroption because it cannot be implemented reliably.
Yeah not sure if anybody has ever used that.