mirror of
https://github.com/zyedidia/micro.git
synced 2026-03-28 22:08:12 +09:00
Split improvements
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user