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)
Fri, Apr 19, 5:37 PM
Unknown Object (File)
Sun, Apr 14, 11:58 AM
Unknown Object (File)
Mon, Apr 8, 1:48 AM
Unknown Object (File)
Mon, Apr 8, 1:07 AM
Unknown Object (File)
Tue, Apr 2, 4:17 PM
Unknown Object (File)
Sun, Mar 31, 2:07 AM
Unknown Object (File)
Thu, Mar 28, 7:51 PM
Unknown Object (File)
Thu, Mar 28, 6:06 PM
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.