aboutsummaryrefslogtreecommitdiff
path: root/ui/tcell/tcell.go
diff options
context:
space:
mode:
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
}