Closed rohieb closed 6 years ago
Hi, and thanks for the report!
I've never tried to apply directly from a colored view, so this has never been an issue for me (and I had never realised the info line was renumbered as it if was part of the diff).
Thanks for pointing to the regex too, although just changing the regex might end up coloring the info hunk as well, which might not be suitable. But I'll definitely have a look into that and find a way to fix it.
Hi @rohieb,
Could you please try to install from the branch git_infoline
of this repo and tell me if it fixes your issue? Display looks fine to me, but I haven't tried to apply the colored patches.
(Uninstall add-on, clone the branch, cd colorediffs
, make
, and install add-on from generated xpi file)
Oh. It seems my mail did not reach GitHub, so for reference, that branch fixes my issue :)
Great! Thanks a lot for testing. I'll try to finish the fixes for compatibility with Thunderbird 59 and then I'll push a new version to AMO.
Consider an email containing the following diff:
This diff contains a section heading
menu "install options "
in the hunk info. When I view this diff in version 0.7 with the "unified" view, the header is reformatted so that it appears as the first context line:The line numbers in the hunk info are recalculated accordingly, so in this case the hunk applies cleanly, but this is not always the case: Header lines can be anything the user wants (mostly the C function which the change was in), but are only interesting for the reader, and not actually interpreted when applying the patch.
I think a fix could be as simple as changing the regex in https://github.com/Qeole/colorediffs/blob/8287043/chrome/content/parsers/unified-parser.js#L374 to include the optional header.