summaryrefslogtreecommitdiffstats
path: root/pkg/gui/gui.go
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2022-08-06 18:05:00 +1000
committerJesse Duffield <jessedduffield@gmail.com>2022-08-06 18:05:00 +1000
commit445a625b56a79be6cee7ec1ee35fe9f4fcc2daad (patch)
tree1258e2bb1f5f486c109b9150e0805ded0d2fac90 /pkg/gui/gui.go
parentcd2c01d1cfb0236ccb7c94a8aae21726ef1283d1 (diff)
rename merging context to mergeConflicts
Diffstat (limited to 'pkg/gui/gui.go')
-rw-r--r--pkg/gui/gui.go29
1 files changed, 3 insertions, 26 deletions
diff --git a/pkg/gui/gui.go b/pkg/gui/gui.go
index 908cede2e..fc9ce6e1a 100644
--- a/pkg/gui/gui.go
+++ b/pkg/gui/gui.go
@@ -19,7 +19,6 @@ import (
"github.com/jesseduffield/lazygit/pkg/config"
"github.com/jesseduffield/lazygit/pkg/gui/context"
"github.com/jesseduffield/lazygit/pkg/gui/controllers/helpers"
- "github.com/jesseduffield/lazygit/pkg/gui/mergeconflicts"
"github.com/jesseduffield/lazygit/pkg/gui/modes/cherrypicking"
"github.com/jesseduffield/lazygit/pkg/gui/modes/diffing"
"github.com/jesseduffield/lazygit/pkg/gui/modes/filtering"
@@ -169,7 +168,6 @@ type GuiRepoState struct {
Suggestions []*types.Suggestion
Updating bool
- Panels *panelStates
SplitMainPanel bool
LimitCommits bool
@@ -199,20 +197,6 @@ type GuiRepoState struct {
CurrentPopupOpts *types.CreatePopupPanelOpts
}
-type MergingPanelState struct {
- *mergeconflicts.State
-
- // UserVerticalScrolling tells us if the user has started scrolling through the file themselves
- // in which case we won't auto-scroll to a conflict.
- UserVerticalScrolling bool
-}
-
-// as we move things to the new context approach we're going to eventually
-// remove this struct altogether and store this state on the contexts.
-type panelStates struct {
- Merging *MergingPanelState
-}
-
type searchingState struct {
view *gocui.View
isSearching bool
@@ -299,13 +283,6 @@ func (gui *Gui) resetState(startArgs types.StartArgs, reuseState bool) {
BisectInfo: git_commands.NewNullBisectInfo(),
FilesTrie: patricia.NewTrie(),
},
-
- Panels: &panelStates{
- Merging: &MergingPanelState{
- State: mergeconflicts.NewState(),
- UserVerticalScrolling: false,
- },
- },
Modes: &types.Modes{
Filtering: filtering.New(startArgs.FilterPath),
CherryPicking: cherrypicking.New(),
@@ -438,7 +415,7 @@ var RuneReplacements = map[rune]string{
graph.CommitSymbol: "o",
}
-func (gui *Gui) initGocui() (*gocui.Gui, error) {
+func (gui *Gui) initGocui(headless bool) (*gocui.Gui, error) {
recordEvents := recordingEvents()
playMode := gocui.NORMAL
if recordEvents {
@@ -447,7 +424,7 @@ func (gui *Gui) initGocui() (*gocui.Gui, error) {
playMode = gocui.REPLAYING
}
- g, err := gocui.NewGui(gocui.OutputTrue, OverlappingEdges, playMode, headless(), RuneReplacements)
+ g, err := gocui.NewGui(gocui.OutputTrue, OverlappingEdges, playMode, headless, RuneReplacements)
if err != nil {
return nil, err
}
@@ -496,7 +473,7 @@ func (gui *Gui) viewTabMap() map[string][]context.TabView {
// Run: setup the gui with keybindings and start the mainloop
func (gui *Gui) Run(startArgs types.StartArgs) error {
- g, err := gui.initGocui()
+ g, err := gui.initGocui(headless())
if err != nil {
return err
}