Skip to content

Commit

Permalink
feat: support number of context lines
Browse files Browse the repository at this point in the history
The default number of context lines is 3 and defined in
`udiff.DefaultContextLines`

Fixes: #5
  • Loading branch information
aymanbagabas committed Dec 13, 2023
1 parent a2d9def commit 5e08ebf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions export.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ type UnifiedDiff = unified

// ToUnifiedDiff takes a file contents and a sequence of edits, and calculates
// a unified diff that represents those edits.
func ToUnifiedDiff(fromName, toName string, content string, edits []Edit) (UnifiedDiff, error) {
return toUnified(fromName, toName, content, edits)
func ToUnifiedDiff(fromName, toName string, content string, edits []Edit, contextLines int) (UnifiedDiff, error) {
return toUnified(fromName, toName, content, edits, contextLines)
}

0 comments on commit 5e08ebf

Please sign in to comment.