Page MenuHomePhabricator

Fix an unusual issue with intradiff highlighting of files with uncommon end-of-file modifications
ClosedPublic

Authored by epriestley on Tue, May 19, 4:04 PM.

Details

Summary

Fixes T13539. See that task for discussion and a reproduction case.

This algorithm currently counts "\ No newline at end of file" lines as though they were normal source lines. This can cause offset issues in the rare case that a diff contains two of these lines (for each side of the file) and has changes between them (because the last line of the file was modified between the diffs).

Instead, don't count "\" as a display line.

Test Plan
  • See T13539 and PHI1740.
  • Before: got fatals on the "wild" diff and the synthetic simplified version.
  • After: clean intradiff rendering in both cases.

Diff Detail

Repository
rP Phabricator
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

epriestley created this revision.Tue, May 19, 4:04 PM
This revision was not accepted when it landed; it landed in state Needs Review.Tue, May 19, 4:05 PM
epriestley requested review of this revision.
This revision was automatically updated to reflect the committed changes.