Skip to content

lack document of DiffDelete/DiffInsert. #84

Open
@bronze1man

Description

@bronze1man

From the document of DiffMatchPatch.DiffMain:

https://github.com/sergi/go-diff/blob/master/diffmatchpatch/diff.go#L49

// DiffMain finds the differences between two texts.
// If an invalid UTF-8 sequence is encountered, it will be replaced by the Unicode replacement character.
func (dmp *DiffMatchPatch) DiffMain(text1, text2 string, checklines bool) []Diff {

From the document of DiffDelete:

https://github.com/sergi/go-diff/blob/master/diffmatchpatch/diff.go#L30

	// DiffDelete item represents a delete diff.
	DiffDelete Operation = -1

So what is the mean of DiffDelete ?

Is DiffDelete mean that text1 do not have this content and text2 has this content? or text2 do not have this content and text1 has this content?

The user can do the experiment to find out that text1 is the old version ,and the text2 is the newer version, so DiffDelete mean that text2 do not have this content and text1 has this content.

But that information is not in the document.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions