diff-match-patch icon indicating copy to clipboard operation
diff-match-patch copied to clipboard

Can patch support line-based?

Open howardgod opened this issue 5 years ago • 2 comments

Can patch support line-based or word-based?

I'd like to use it to generate unified format just like git diff's ouput

howardgod avatar Apr 22 '20 16:04 howardgod

Hmm, I've found a private method on the java version that seem to exactly do that, I'm not sure though https://github.com/google/diff-match-patch/blob/62f2e689f498f9c92dbc588c58750addec9b1654/java/src/name/fraser/neil/plaintext/diff_match_patch.java#L286

iyxan23 avatar Jan 17 '21 01:01 iyxan23

every library should have a line-mode diffing option, which may be used in normal operation if the input documents are long enough

the libraries also expose patch_toText as described in the wiki if you are wanting standard diff output

dmsnell avatar Apr 08 '21 21:04 dmsnell