Documentation
¶
Index ¶
Constants ¶
const ( Local = 1 Incoming = 2 )
Represents user's conflict resolution decision
Variables ¶
ErrInvalidManualInput is thrown when the manual code editing session results in deletion of the conflict markers in the text
Functions ¶
This section is empty.
Types ¶
type Conflict ¶
type Conflict struct {
File *File
Choice int
Start int
Middle int
End int
Diff3 []int
LocalLines []string
LocalPureLines []string
IncomingLines []string
ColoredLocalLines []string
ColoredIncomingLines []string
CurrentName string
ForeignName string
TopPeek int
BottomPeek int
}
Conflict represents a single conflict that may have occurred
func ExtractConflicts ¶
ExtractConflicts extracts all conflicts from the provided `File` It returns an error if it fails to parse the conflict markers and if syntax highlighting fatally fails TODO: Prevent crashes from syntax highlighting
func GroupConflictMarkers ¶
GroupConflictMarkers groups the provided lines of a file into individual `Conflict` structs It returns an error if the line contains invalid number of conflicts. This may be caused if the user manually edits the file.
func (Conflict) Equal ¶
Equal checks if two `Conflict`s are equal
func (*Conflict) Extract ¶ added in v1.1.0
Extract extracts lines where conflicts exist and corresponding branch names
func (*Conflict) HighlightSyntax ¶ added in v1.0.4
HighlightSyntax highlights the stored file lines; both local and incoming lines The highlighted versions of the lines are stored in Conflict.Colored____Lines If the file extension is not supported, no highlights are applied
func (*Conflict) PaddingLines ¶
PaddingLines returns top and bottom padding lines based on `TopPeek` and `BottomPeek` values
func (*Conflict) Update ¶
Update takes the user's input from an editor and updates the current representation of `Conflict`
Source Files
¶
- command.go
- conflict.go
- file.go
- parse.go
- test.go