Reorganize info bar

This commit is contained in:
Zachary Yedidia
2019-01-01 22:36:12 -05:00
parent adc70af0be
commit b43c5ed3e7
8 changed files with 57 additions and 44 deletions

View File

@@ -12,8 +12,6 @@ import (
"github.com/zyedidia/micro/cmd/micro/action"
"github.com/zyedidia/micro/cmd/micro/buffer"
"github.com/zyedidia/micro/cmd/micro/config"
"github.com/zyedidia/micro/cmd/micro/display"
"github.com/zyedidia/micro/cmd/micro/info"
"github.com/zyedidia/micro/cmd/micro/screen"
"github.com/zyedidia/micro/cmd/micro/util"
"github.com/zyedidia/tcell"
@@ -193,11 +191,9 @@ func main() {
b := LoadInput()[0]
width, height := screen.Screen.Size()
ep := NewBufEditPane(0, 0, width, height-1, b)
ep := action.NewBufEditPane(0, 0, width, height-1, b)
info.InitInfoBar()
infowindow := display.NewInfoWindow(info.MainBar)
infobar := action.NewBufHandler(info.MainBar.Buffer, infowindow)
action.InitGlobals()
// Here is the event loop which runs in a separate thread
go func() {
@@ -214,7 +210,7 @@ func main() {
screen.Screen.Fill(' ', config.DefStyle)
screen.Screen.HideCursor()
ep.Display()
infowindow.Display()
action.InfoBar.Display()
screen.Screen.Show()
var event tcell.Event
@@ -225,8 +221,8 @@ func main() {
}
if event != nil {
if info.MainBar.HasPrompt {
infobar.HandleEvent(event)
if action.InfoBar.HasPrompt {
action.InfoBar.HandleEvent(event)
} else {
ep.HandleEvent(event)
}