From 661e3ec2a4dd97d4a8a8eab4f281b088770a6af2 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Mon, 26 Feb 2018 22:41:54 -0500 Subject: Implement basic ex line input TODO: - scrolling - commit/cancel - command history (via an external command history provider) - tab completion (via an external tab completion provider) --- cmd/aerc/main.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'cmd') diff --git a/cmd/aerc/main.go b/cmd/aerc/main.go index c784948..3ba9d1a 100644 --- a/cmd/aerc/main.go +++ b/cmd/aerc/main.go @@ -70,9 +70,8 @@ func main() { fill('.'), ui.BORDER_RIGHT)).At(1, 0).Span(2, 1) grid.AddChild(tabs.TabStrip).At(0, 1) grid.AddChild(tabs.TabContent).At(1, 1) - // ex line placeholder: - grid.AddChild(ui.NewText("Connected"). - Color(tb.ColorBlack, tb.ColorWhite)).At(2, 1) + exline := ui.NewExLine() + grid.AddChild(exline).At(2, 1) _ui, err := ui.Initialize(conf, grid) if err != nil { @@ -80,6 +79,8 @@ func main() { } defer _ui.Close() + _ui.AddInteractive(exline) + go (func() { for { time.Sleep(1 * time.Second) @@ -89,7 +90,8 @@ func main() { for !_ui.Exit { if !_ui.Tick() { - time.Sleep(100 * time.Millisecond) + // ~60 FPS + time.Sleep(16 * time.Millisecond) } } } -- cgit v1.2.3