MCPcopy Create free account
hub / github.com/sergi/go-diff / DiffLinesToRunes

Method DiffLinesToRunes

diffmatchpatch/diff.go:402–405  ·  view source on GitHub ↗

DiffLinesToRunes splits two texts into a list of runes. At most 1,112,060 unique lines can be encoded across both texts; if the texts contain more unique lines, this function panics.

(text1, text2 string)

Source from the content-addressed store, hash-verified

400// DiffLinesToRunes splits two texts into a list of runes.
401// At most 1,112,060 unique lines can be encoded across both texts; if the texts contain more unique lines, this function panics.
402func (dmp *DiffMatchPatch) DiffLinesToRunes(text1, text2 string) ([]rune, []rune, []string) {
403 chars1, chars2, lineArray := dmp.diffLinesToStrings(text1, text2)
404 return []rune(chars1), []rune(chars2), lineArray
405}
406
407// DiffCharsToLines rehydrates the text in a diff from a string of line hashes to real lines of text.
408func (dmp *DiffMatchPatch) DiffCharsToLines(diffs []Diff, lineArray []string) []Diff {

Callers 3

diffLineModeMethod · 0.95

Calls 1

diffLinesToStringsMethod · 0.95