Skip to content

feat: semantic cleanup post-pass (human-friendlier diffs) #17

Description

@krkarma777

Problem

Minimal edit scripts sometimes align on short coincidental islands (a stray equal token inside what a human reads as one replaced block). diff-match-patch ships `cleanupSemantic` for this; we have `refine` (finer) but nothing that coarsens noisy regions.

Proposal

Opt-in `cleanup: 'semantic'` post-pass: merge equal islands shorter than the surrounding change into the change, and shift change boundaries to word/line edges where equivalent (boundary sliding, like git's diff-slider heuristics).

Notes

  • Must preserve the round-trip invariant; only regroups entries.
  • Add before/after examples to the README and demo.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions