Page MenuHomePhabricator

Slightly improve some prose diffs
ClosedPublic

Authored by epriestley on Nov 7 2016, 10:44 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Dec 18, 6:54 AM
Unknown Object (File)
Wed, Dec 18, 6:48 AM
Unknown Object (File)
Wed, Dec 11, 3:54 AM
Unknown Object (File)
Mon, Dec 9, 12:46 PM
Unknown Object (File)
Sun, Dec 8, 10:05 AM
Unknown Object (File)
Thu, Dec 5, 2:10 AM
Unknown Object (File)
Thu, Nov 28, 6:43 AM
Unknown Object (File)
Sun, Nov 24, 7:24 AM
Subscribers
None

Details

Summary

Ref T7643. There are still some silly cases, but I think this improves behavior a bit:

  • At the top level, treat whitespace tokens separately. This significantly improves adding or removing paragraphs.
  • Fix a bug with diff construction where prefixes and suffixes could overlap on pure whitespace tokens.

There are still some other cases that we don't do a great job on but I think I need to adjust the approach a bit to really improve them.

Test Plan

Added a unit test with a pargraph addition, made it pass.

Diff Detail

Repository
rPHU libphutil
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

epriestley retitled this revision from to Slightly improve some prose diffs.
epriestley updated this object.
epriestley edited the test plan for this revision. (Show Details)
epriestley added a reviewer: chad.
chad edited edge metadata.
This revision is now accepted and ready to land.Nov 7 2016, 10:53 PM
This revision was automatically updated to reflect the committed changes.