aboutsummaryrefslogtreecommitdiff
path: root/ui/tcell/tcell.go
diff options
context:
space:
mode:
authorPetter Rodhelind <petter.rodhelind@gmail.com>2021-03-05 11:17:53 +0100
committerPetter Rodhelind <petter.rodhelind@gmail.com>2021-03-05 11:17:53 +0100
commitbc42522f2958287f952145ae50b3e426b7b69e37 (patch)
treee8b380063e8a7fd21b2360f2e7117e4e705443dd /ui/tcell/tcell.go
parent952b26f6e2a32163590134639362db7af4fb62c6 (diff)
downloadpoe-bc42522f2958287f952145ae50b3e426b7b69e37.tar.gz
poe-bc42522f2958287f952145ae50b3e426b7b69e37.tar.bz2
poe-bc42522f2958287f952145ae50b3e426b7b69e37.zip
Only open 2-split if no file was given on startup.
Diffstat (limited to 'ui/tcell/tcell.go')
-rw-r--r--ui/tcell/tcell.go12
1 files changed, 7 insertions, 5 deletions
diff --git a/ui/tcell/tcell.go b/ui/tcell/tcell.go
index e7c6009..9783a86 100644
--- a/ui/tcell/tcell.go
+++ b/ui/tcell/tcell.go
@@ -34,10 +34,6 @@ type Tcell struct{}
func (t *Tcell) Init(e editor.Editor) error {
ed = e
- if ed.Len() == 0 {
- ed.LoadBuffers([]string{"."})
- }
-
if err := initScreen(); err != nil {
return err
}
@@ -50,6 +46,10 @@ func (t *Tcell) Init(e editor.Editor) error {
return err
}
+ if ed.Len() == 0 {
+ ed.LoadBuffers([]string{"."})
+ }
+
if err := initWindows(); err != nil {
return err
}
@@ -116,7 +116,9 @@ func initScreen() error {
func initWorkspace() error {
workspace = &Workspace{} // first resize event will set proper dimensions
workspace.AddCol()
- workspace.AddCol()
+ if ids, _ := ed.Buffers(); len(ids) == 0 {
+ workspace.AddCol()
+ }
return nil
}