- 
                Notifications
    You must be signed in to change notification settings 
- Fork 27
Fix interdiff context trimming when output is colorized #119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
When interdiff's output is set as colorized, that means the output from the diff execution inside interdiff contains color escape codes. The color escape codes break trim_context(), which doesn't expect a line to start with an escape character. Fix trim_context() to handle colorized output from diff.
755c9fd    to
    72b04ab      
    Compare
  
    72b04ab    to
    755c9fd      
    Compare
  
    | Codecov Report❌ Patch coverage is  
 Additional details and impacted files@@            Coverage Diff             @@
##           master     #119      +/-   ##
==========================================
- Coverage   82.39%   82.30%   -0.10%     
==========================================
  Files           5        5              
  Lines        4130     4137       +7     
  Branches      983      985       +2     
==========================================
+ Hits         3403     3405       +2     
- Misses        727      732       +5     
 Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
 | 
| Oh, I see, the colour support isn't as easy as I'd hoped. Probably the answer is not to pass through the   | 
| Added a test case for this in #121 | 
| 
 Agreed, I had come to the same conclusion as well :) | 
Fixed: #119 Assisted-by: Cursor
Fixed: #119 Assisted-by: Cursor
| Think I have a workable fix in #123. | 
| I think automatic color is fine since it's in line with diff's default behavior. | 
| 
 Oops, I was thinking of git diff's default behavior. diff doesn't colorize by default; nonetheless, I think --color=auto by default is the right choice going off of git diff. 🙂 | 
Fixed: #119 Assisted-by: Cursor
| Closing in favour of #123 | 
Fixed: #119 Assisted-by: Cursor

When interdiff's output is set as colorized, that means the output from the diff execution inside interdiff contains color escape codes. The color escape codes break trim_context(), which doesn't expect a line to start with an escape character.
Fix trim_context() to handle colorized output from diff.