Closed NHDaly closed 9 years ago
Oh, I've broken the builds because I changed the markdown output. Let me know if I need to mark this pull request with something after you've looked at it! :)
Sorry I haven't looked into the details, but I think cdiff does the right thing. The base_color is required as the design is to use different base color for del and add lines.
On Sunday, May 10, 2015, Nathan Daly notifications@github.com wrote:
Oh, I've broken the builds because I changed the markdown output. Let me know if I need to mark this pull request with something after you've looked at it! :)
— Reply to this email directly or view it on GitHub https://github.com/ymattw/cdiff/issues/47#issuecomment-100772365.
No problem. Yeah, I think it looks like the right thing, but it's actually setting the base_color twice, that's the issue. Once at line 455 before the reverse
, and once where i've deleted it after the reverse
, so the outcome is the base_color in the fg and bg.
But actually, I didn't notice before that this is a while-loop... so maybe my change isn't correct in all the cases either...
Maybe we should just remove the statement on line 455?
But does the problem I'm describing make sense? Thanks for taking a look at this! :)
It should be an issue of aha
. Cdiff is doing the right thing, the duplicate base_color comes from upstream python difflib. It's not worth to optimize there.
Closing as this should be either enhanced in difflib or fixed in tool aha
.
cdiff outputs block diffed text with red foreground AND red background, or green foreground AND green background, but I think the terminal is kind enough to display it with just the background color set. I noticed this when I was converting output from
cdiff
to html usingaha
. For example (I've trimmed a bit of the unnecessary bits):I think it's because aha is converting from
which you'll notice has
ESC[31mESC[7mESC[31ma
, which I think should just beESC[31mESC[7ma
. As it is, it sets the foreground, reverses, and then sets the foreground again.