Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
akiyosi committed May 7, 2021
1 parent ea955ed commit 86d1e8a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
6 changes: 6 additions & 0 deletions editor/editor.go
Expand Up @@ -801,12 +801,18 @@ func (e *Editor) workspaceUpdate() {
}
}
for i := 0; i < len(e.side.items) && i < len(e.workspaces); i++ {
if e.side.items[i] == nil {
continue
}
// e.workspaces[i].setCwd(e.workspaces[i].cwdlabel)
e.side.items[i].setSideItemLabel(i)
// e.side.items[i].setText(e.workspaces[i].cwdlabel)
e.side.items[i].show()
}
for i := len(e.workspaces); i < len(e.side.items); i++ {
if e.side.items[i] == nil {
continue
}
e.side.items[i].hide()
}
}
Expand Down
4 changes: 2 additions & 2 deletions editor/workspace.go
Expand Up @@ -245,10 +245,10 @@ func newWorkspace(path string) (*Workspace, error) {
w.widget.Move2(0, 0)
editor.putLog("assembled UI components")

go w.tabline.initTab()

go w.startNvim(path)

w.tabline.initTab()

return w, nil
}

Expand Down
3 changes: 3 additions & 0 deletions util/utils.go
Expand Up @@ -235,6 +235,9 @@ func NewVFlowLayout(spacing int, padding int, paddingTop int, rightIdex int, wid
}
}
for i, item := range items {
if len(sizes) <= i {
return
}
size := sizes[i]
width := size[0]
height := size[1]
Expand Down

0 comments on commit 86d1e8a

Please sign in to comment.