forked from toolshed/abra
refactor: urfave v3
This commit is contained in:
6
vendor/github.com/sergi/go-diff/diffmatchpatch/diff.go
generated
vendored
6
vendor/github.com/sergi/go-diff/diffmatchpatch/diff.go
generated
vendored
@ -157,9 +157,9 @@ func (dmp *DiffMatchPatch) diffCompute(text1, text2 []rune, checklines bool, dea
|
||||
}
|
||||
// Shorter text is inside the longer text (speedup).
|
||||
return []Diff{
|
||||
{op, string(longtext[:i])},
|
||||
{DiffEqual, string(shorttext)},
|
||||
{op, string(longtext[i+len(shorttext):])},
|
||||
Diff{op, string(longtext[:i])},
|
||||
Diff{DiffEqual, string(shorttext)},
|
||||
Diff{op, string(longtext[i+len(shorttext):])},
|
||||
}
|
||||
} else if len(shorttext) == 1 {
|
||||
// Single character string.
|
||||
|
4
vendor/github.com/sergi/go-diff/diffmatchpatch/patch.go
generated
vendored
4
vendor/github.com/sergi/go-diff/diffmatchpatch/patch.go
generated
vendored
@ -93,7 +93,7 @@ func (dmp *DiffMatchPatch) PatchAddContext(patch Patch, text string) Patch {
|
||||
// Add the prefix.
|
||||
prefix := text[max(0, patch.Start2-padding):patch.Start2]
|
||||
if len(prefix) != 0 {
|
||||
patch.diffs = append([]Diff{{DiffEqual, prefix}}, patch.diffs...)
|
||||
patch.diffs = append([]Diff{Diff{DiffEqual, prefix}}, patch.diffs...)
|
||||
}
|
||||
// Add the suffix.
|
||||
suffix := text[patch.Start2+patch.Length1 : min(len(text), patch.Start2+patch.Length1+padding)]
|
||||
@ -336,7 +336,7 @@ func (dmp *DiffMatchPatch) PatchAddPadding(patches []Patch) string {
|
||||
// Add some padding on start of first diff.
|
||||
if len(patches[0].diffs) == 0 || patches[0].diffs[0].Type != DiffEqual {
|
||||
// Add nullPadding equality.
|
||||
patches[0].diffs = append([]Diff{{DiffEqual, nullPadding}}, patches[0].diffs...)
|
||||
patches[0].diffs = append([]Diff{Diff{DiffEqual, nullPadding}}, patches[0].diffs...)
|
||||
patches[0].Start1 -= paddingLength // Should be 0.
|
||||
patches[0].Start2 -= paddingLength // Should be 0.
|
||||
patches[0].Length1 += paddingLength
|
||||
|
Reference in New Issue
Block a user