diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2019-11-04 19:47:25 +1100 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2019-11-05 19:22:01 +1100 |
commit | d5e443e8e3609fe38586aed942a3dae3343dbe47 (patch) | |
tree | 6d7465b9abd8df3ae903e6d95898054ac3a6d8b4 /pkg/gui/gui.go | |
parent | a3c84296bf2fbc8b132d5b2285eedba09813fbee (diff) |
Support building and moving patches
WIP
Diffstat (limited to 'pkg/gui/gui.go')
-rw-r--r-- | pkg/gui/gui.go | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/pkg/gui/gui.go b/pkg/gui/gui.go index e66df31d8..ea71d9dca 100644 --- a/pkg/gui/gui.go +++ b/pkg/gui/gui.go @@ -23,7 +23,6 @@ import ( "github.com/jesseduffield/gocui" "github.com/jesseduffield/lazygit/pkg/commands" "github.com/jesseduffield/lazygit/pkg/config" - "github.com/jesseduffield/lazygit/pkg/git" "github.com/jesseduffield/lazygit/pkg/i18n" "github.com/jesseduffield/lazygit/pkg/theme" "github.com/jesseduffield/lazygit/pkg/updates" @@ -84,13 +83,13 @@ type Gui struct { // non-mutative, so that we don't accidentally end up // with mismatches of data. We might change this in the future type stagingPanelState struct { - SelectedLineIdx int - FirstLineIdx int - LastLineIdx int - Diff string - PatchParser *git.PatchParser - SelectMode int // one of LINE, HUNK, or RANGE - IndexFocused bool // this is for if we show the left or right panel + SelectedLineIdx int + FirstLineIdx int + LastLineIdx int + Diff string + PatchParser *commands.PatchParser + SelectMode int // one of LINE, HUNK, or RANGE + SecondaryFocused bool // this is for if we show the left or right panel } type mergingPanelState struct { @@ -152,8 +151,11 @@ type guiState struct { Contexts map[string]string CherryPickedCommits []*commands.Commit SplitMainPanel bool + PatchManager *commands.PatchManager } +// for now the split view will always be on + // NewGui builds a new gui handler func NewGui(log *logrus.Entry, gitCommand *commands.GitCommand, oSCommand *commands.OSCommand, tr *i18n.Localizer, config config.AppConfigurer, updater *updates.Updater) (*Gui, error) { @@ -390,7 +392,7 @@ func (gui *Gui) layout(g *gocui.Gui) error { main := "main" secondary := "secondary" - swappingMainPanels := gui.State.Panels.Staging != nil && gui.State.Panels.Staging.IndexFocused + swappingMainPanels := gui.State.Panels.Staging != nil && gui.State.Panels.Staging.SecondaryFocused if swappingMainPanels { main = "secondary" secondary = "main" |