Homec4science

Slightly improve some prose diffs

Authored by epriestley <git@epriestley.com> on Nov 7 2016, 21:52.

Description

Slightly improve some prose diffs

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.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T7643

Differential Revision: https://secure.phabricator.com/D16820

Details

Committed
epriestley <git@epriestley.com>Nov 7 2016, 23:54
Pushed
aubortMar 17 2017, 12:03
Parents
rPHU77c4e8b7c77e: When converting an absolute datetime to an absolute datetime, just clone it
Branches
Unknown
Tags
Unknown

Event Timeline

epriestley <git@epriestley.com> committed rPHU5d8e090fe1e2: Slightly improve some prose diffs (authored by epriestley <git@epriestley.com>).Nov 7 2016, 23:54