diff options
author | Petter Rodhelind <petter.rodhelind@gmail.com> | 2021-03-05 11:17:53 +0100 |
---|---|---|
committer | Petter Rodhelind <petter.rodhelind@gmail.com> | 2021-03-05 11:17:53 +0100 |
commit | bc42522f2958287f952145ae50b3e426b7b69e37 (patch) | |
tree | e8b380063e8a7fd21b2360f2e7117e4e705443dd /ui/tcell | |
parent | 952b26f6e2a32163590134639362db7af4fb62c6 (diff) | |
download | poe-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')
-rw-r--r-- | ui/tcell/tcell.go | 12 |
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 } |