Skip to content

Commit

Permalink
Change bool Resolved conflict variable to Choice int variable
Browse files Browse the repository at this point in the history
  • Loading branch information
mkchoi212 committed Dec 30, 2017
1 parent 93fde8a commit 28a354a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions conflict.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (

// Conflict represents a single conflict that may have occured
type Conflict struct {
Resolved bool
Choice int
FileName string
AbsolutePath string
Start int
Expand All @@ -30,10 +30,10 @@ type Conflict struct {
}

const (
Local = 0
Incoming = 1
Up = 2
Down = 3
Local = 1
Incoming = 2
Up = 3
Down = 4
)

func (c *Conflict) isEqual(c2 *Conflict) bool {
Expand All @@ -54,7 +54,7 @@ func (c *Conflict) Select(g *gocui.Gui, showHelp bool) error {

for idx, conflict := range conflicts {
var out string
if conflict.Resolved {
if conflict.Choice != 0 {
out = Green(Regular, "✅ %s:%d", conflict.FileName, conflict.Start)
} else {
out = Red(Regular, "%d. %s:%d", idx+1, conflict.FileName, conflict.Start)
Expand Down Expand Up @@ -140,7 +140,7 @@ func (c *Conflict) getPaddingLines() (topPadding, bottomPadding []string) {

func (c *Conflict) Resolve(g *gocui.Gui, v *gocui.View, version int) error {
g.Update(func(g *gocui.Gui) error {
c.Resolved = true
c.Choice = version
nextConflict(g, v)
return nil
})
Expand Down
2 changes: 1 addition & 1 deletion summary.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func printSummary() {
var line string

for _, c := range conflicts {
if c.Resolved {
if c.Choice != 0 {
line = Green(Regular, "✔ %s: %d", c.FileName, c.Start)
resolvedCnt++
} else {
Expand Down

0 comments on commit 28a354a

Please sign in to comment.