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
Unknown Object (File)
Tue, Apr 30, 12:41 PM
Unknown Object (File)
Wed, Apr 17, 1:26 PM
Unknown Object (File)
Apr 1 2024, 1:55 AM
Unknown Object (File)
Mar 31 2024, 9:46 PM
Unknown Object (File)
Feb 14 2024, 7:10 AM
Unknown Object (File)
Dec 25 2023, 1:46 AM
Unknown Object (File)
Dec 19 2023, 9:10 PM
Unknown Object (File)
Nov 30 2023, 5:39 AM
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
Branch
idiff1
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 24460
Build 33705: Run Core Tests
Build 33704: arc lint + arc unit