Page MenuHomePhabricator

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

Authored by epriestley on May 19 2020, 4:04 PM.
Tags
None
Referenced Files
F18985493: D21267.id.diff
Mon, Nov 17, 1:04 PM
F18854752: D21267.diff
Nov 1 2025, 12:35 AM
F18809918: D21267.id.diff
Oct 19 2025, 6:07 PM
F18806967: D21267.id50642.diff
Oct 18 2025, 10:15 PM
F18806774: D21267.diff
Oct 18 2025, 9:28 PM
F18762439: D21267.id50641.diff
Oct 6 2025, 7:01 PM
F18606027: D21267.diff
Sep 13 2025, 9:47 PM
F18110199: D21267.id50641.diff
Aug 11 2025, 5:14 PM
Subscribers
None

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
Lint Not Applicable
Unit
Tests Not Applicable