mirror of
https://github.com/bluekeyes/go-gitdiff
synced 2026-06-08 13:18:30 +00:00
Implement text application using LineReaderAt
This is functionally equivalent to the previous version (except for one error case), but uses the new interface. I think the code is simpler overall because it removes the line tracking.
This commit is contained in:
+2
-2
@@ -139,12 +139,12 @@ func (fl Line) String() string {
|
||||
|
||||
// Old returns true if the line appears in the old content of the fragment.
|
||||
func (fl Line) Old() bool {
|
||||
return fl.Op != OpAdd
|
||||
return fl.Op == OpContext || fl.Op == OpDelete
|
||||
}
|
||||
|
||||
// New returns true if the line appears in the new content of the fragment.
|
||||
func (fl Line) New() bool {
|
||||
return fl.Op == OpAdd
|
||||
return fl.Op == OpContext || fl.Op == OpAdd
|
||||
}
|
||||
|
||||
// NoEOL returns true if the line is missing a trailing newline character.
|
||||
|
||||
Reference in New Issue
Block a user