summaryrefslogtreecommitdiffstats
path: root/pkg/gui/staging_panel.go
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2019-02-16 12:07:27 +1100
committerJesse Duffield <jessedduffield@gmail.com>2019-02-16 12:07:27 +1100
commit198cbee498e9201b1f12514f909eb3da98db5ec7 (patch)
treea315ad46dd3b170ce3e9c3a826853affe97d5d93 /pkg/gui/staging_panel.go
parentdaca07eacac8bc5cb7bcf65a762ed5093f2b8a82 (diff)
introduce panel contexts and more work on rebasing
Diffstat (limited to 'pkg/gui/staging_panel.go')
-rw-r--r--pkg/gui/staging_panel.go17
1 files changed, 11 insertions, 6 deletions
diff --git a/pkg/gui/staging_panel.go b/pkg/gui/staging_panel.go
index 099dd5da8..5d52cf081 100644
--- a/pkg/gui/staging_panel.go
+++ b/pkg/gui/staging_panel.go
@@ -66,14 +66,19 @@ func (gui *Gui) refreshStagingPanel() error {
if err := gui.focusLineAndHunk(); err != nil {
return err
}
- return gui.renderString(gui.g, "staging", colorDiff)
+
+ mainView := gui.getMainView()
+ mainView.Highlight = true
+ mainView.Wrap = false
+
+ gui.g.Update(func(*gocui.Gui) error {
+ return gui.setViewContent(gui.g, gui.getMainView(), colorDiff)
+ })
+
+ return nil
}
func (gui *Gui) handleStagingEscape(g *gocui.Gui, v *gocui.View) error {
- if _, err := gui.g.SetViewOnBottom("staging"); err != nil {
- return err
- }
-
gui.State.Panels.Staging = nil
return gui.switchFocus(gui.g, nil, gui.getFilesView())
@@ -138,7 +143,7 @@ func (gui *Gui) handleCycleLine(prev bool) error {
// focusLineAndHunk works out the best focus for the staging panel given the
// selected line and size of the hunk
func (gui *Gui) focusLineAndHunk() error {
- stagingView := gui.getStagingView()
+ stagingView := gui.getMainView()
state := gui.State.Panels.Staging
lineNumber := state.StageableLines[state.SelectedLine]