summaryrefslogtreecommitdiffstats
path: root/pkg/gui/view_helpers.go
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2020-08-18 08:26:40 +1000
committerJesse Duffield <jessedduffield@gmail.com>2020-08-23 14:29:18 +1000
commit0f7b2c45d773989229cb84a0147232962c6ae0e0 (patch)
treebec3948a7cc786d5d7fb6cf5cb2e6b14a832f6a8 /pkg/gui/view_helpers.go
parenta12d18146ccd2847ef04377703baff58e209373d (diff)
centralise split main panel code
Diffstat (limited to 'pkg/gui/view_helpers.go')
-rw-r--r--pkg/gui/view_helpers.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/pkg/gui/view_helpers.go b/pkg/gui/view_helpers.go
index df3dc5ece..137e0e96f 100644
--- a/pkg/gui/view_helpers.go
+++ b/pkg/gui/view_helpers.go
@@ -368,3 +368,16 @@ func (gui *Gui) clearEditorView(v *gocui.View) {
_ = v.SetCursor(0, 0)
_ = v.SetOrigin(0, 0)
}
+
+func (gui *Gui) splitMainPanel(state bool) {
+ gui.State.SplitMainPanel = state
+
+ // no need to set view on bottom when state is false: it will have zero size anyway thanks to our view arrangement code.
+ if state {
+ _, _ = gui.g.SetViewOnTop("secondary")
+ }
+}
+
+func (gui *Gui) isMainPanelSplit() bool {
+ return gui.State.SplitMainPanel
+}