summaryrefslogtreecommitdiffstats
path: root/pkg/gui/gui.go
diff options
context:
space:
mode:
authorMark Kopenga <mkopenga@gmail.com>2018-12-06 08:31:12 +0100
committerGitHub <noreply@github.com>2018-12-06 08:31:12 +0100
commit1b6d34e76a4d5d132f95072139fb3aba760eb771 (patch)
treefb6cc607a67f0d3d2ef0b9d66fafd439864e6d9a /pkg/gui/gui.go
parent67115436347dec591d12a1a31d1c971915cf0b05 (diff)
parent1a6a69a8f1f7c44978a384ba56321149f973223d (diff)
Merge branch 'master' into https-ask-for-username-password
Diffstat (limited to 'pkg/gui/gui.go')
-rw-r--r--pkg/gui/gui.go21
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