diff options
author | Mark Kopenga <mkopenga@gmail.com> | 2018-12-06 08:31:12 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-06 08:31:12 +0100 |
commit | 1b6d34e76a4d5d132f95072139fb3aba760eb771 (patch) | |
tree | fb6cc607a67f0d3d2ef0b9d66fafd439864e6d9a /pkg/gui/gui.go | |
parent | 67115436347dec591d12a1a31d1c971915cf0b05 (diff) | |
parent | 1a6a69a8f1f7c44978a384ba56321149f973223d (diff) |
Merge branch 'master' into https-ask-for-username-password
Diffstat (limited to 'pkg/gui/gui.go')
-rw-r--r-- | pkg/gui/gui.go | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/pkg/gui/gui.go b/pkg/gui/gui.go index 45284130c..767a25bde 100644 --- a/pkg/gui/gui.go +++ b/pkg/gui/gui.go @@ -74,6 +74,13 @@ type Gui struct { credentials credentials } +type stagingState struct { + StageableLines []int + HunkStarts []int + CurrentLineIndex int + Diff string +} + type guiState struct { Files []*commands.File Branches []*commands.Branch @@ -87,6 +94,7 @@ type guiState struct { EditHistory *stack.Stack Platform commands.Platform Updating bool + StagingState *stagingState } // NewGui builds a new gui handler @@ -210,6 +218,19 @@ func (gui *Gui) layout(g *gocui.Gui) error { v.FgColor = gocui.ColorWhite } + v, err = g.SetView("staging", leftSideWidth+panelSpacing, 0, width-1, optionsTop, gocui.LEFT) + if err != nil { + if err != gocui.ErrUnknownView { + return err + } + v.Title = gui.Tr.SLocalize("StagingTitle") + v.Highlight = true + v.FgColor = gocui.ColorWhite + if _, err := g.SetViewOnBottom("staging"); err != nil { + return err + } + } + if v, err := g.SetView("status", 0, 0, leftSideWidth, statusFilesBoundary, gocui.BOTTOM|gocui.RIGHT); err != nil { if err != gocui.ErrUnknownView { return err |