Split improvements

This commit is contained in:
Zachary Yedidia
2019-01-05 16:27:04 -05:00
parent 93aed1ab9f
commit 305f4debff
7 changed files with 125 additions and 35 deletions

View File

@@ -31,6 +31,7 @@ func NewBufEditPane(x, y, width, height int, b *buffer.Buffer) *EditPane {
func NewTabPane(width, height int, b *buffer.Buffer) *TabPane {
t := new(TabPane)
t.Node = views.NewRoot(0, 0, width, height)
t.Window = display.NewUIWindow(t.Node)
e := NewBufEditPane(0, 0, width, height, b)
e.splitID = t.ID()

View File

@@ -1,6 +1,8 @@
package action
import (
"github.com/zyedidia/micro/cmd/micro/display"
"github.com/zyedidia/micro/cmd/micro/screen"
"github.com/zyedidia/micro/cmd/micro/views"
"github.com/zyedidia/tcell"
)
@@ -9,12 +11,20 @@ var MainTab *TabPane
type TabPane struct {
*views.Node
display.Window
Panes []*EditPane
active int
resizing bool
}
func (t *TabPane) HandleEvent(event tcell.Event) {
switch e := event.(type) {
case *tcell.EventResize:
w, h := screen.Screen.Size()
InfoBar.Resize(w, h-1)
t.Node.Resize(w, h-1)
t.Resize()
case *tcell.EventMouse:
switch e.Buttons() {
case tcell.Button1: