diff options
author | Mateusz Czapliński <czapkofan@gmail.com> | 2018-03-04 16:44:45 +0100 |
---|---|---|
committer | Mateusz Czapliński <czapkofan@gmail.com> | 2018-03-04 16:44:45 +0100 |
commit | 1525c1dfb5483611d9509b95f28c61039cc6c906 (patch) | |
tree | f5a876e5d056077d8e54c8aceb2ea2763ef08ea5 | |
parent | 6b1f150971241f513e3861c2ecb5ceb2397fcf89 (diff) |
remove old junk
-rw-r--r-- | up.go | 77 |
1 files changed, 0 insertions, 77 deletions
@@ -11,11 +11,6 @@ import ( "github.com/mattn/go-isatty" ) -const ( - queryTag = "query" - outputTag = "output" -) - func main() { // TODO: Without below block, we'd hang with no piped input (see github.com/peco/peco, mattn/gof, fzf, etc.) if isatty.IsTerminal(os.Stdin.Fd()) { @@ -48,73 +43,6 @@ func main() { } } - // // Init TUI code - // tui, err := tcell.NewScreen() - // if err != nil { - // panic(err) - // } - // err = tui.Init() - // if err != nil { - // panic(err) - // } - // defer tui.Fini() - // // FIXME: wide rune support, combining marks, etc. - // for x, ch := range "hello world! :)" { - // tui.SetContent(x, 0, ch, nil, tcell.StyleDefault) - // } - // for { - // event := tui.PollEvent() - // switch event := event.(type) { - // case *tcell.EventError: - // panic(event) - // case *tcell.EventKey: - // switch event.Key() { - // case tcell.KeyCtrlC, tcell.KeyEsc: - // return - // case tcell.KeyRune: - // if event.Rune() == 'q' { - // return - // } - // } - // } - // } - - // tui, err := gocui.NewGui(gocui.OutputNormal) - // if err != nil { - // panic(err) - // } - // defer tui.Close() - - // Prepare TUI layout etc. - - // tui.SetManagerFunc(layout) - // w, h := tui.Size() - // query, err := tui.SetView(queryTag, 0, 0, w-1, 3) - // if err != nil && err != gocui.ErrUnknownView { - // panic(err) - // } - // query.Title = "Command" - // query.BgColor = gocui.ColorCyan - // query.Editable = true - // // query.Editor = gocui.DefaultEditor - // output, err := tui.SetView(outputTag, 0, 3, w-1, h-1) - // if err != nil && err != gocui.ErrUnknownView { - // panic(err) - // } - // output.Title = "Output" - // output.Autoscroll = true - // err = tui.SetKeybinding(queryTag, gocui.KeyCtrlC, gocui.ModNone, func(*gocui.Gui, *gocui.View) error { - // return gocui.ErrQuit - // }) - // if err != nil { - // panic(err) - // } - // tui.SetCurrentView(queryTag) - // err = tui.MainLoop() - // if err != nil && err != gocui.ErrQuit { - // panic(err) - // } - // TODO: using tcell, edit a command in bash format in multiline input box (or jroimartin/gocui?) // NOTE: gocui has trouble if we capture stdin. Try butchering ("total modding") peco/peco instead. // TODO: run it automatically in bg after first " " (or ^Enter), via `bash -c` @@ -153,8 +81,3 @@ func collect() { buf = buf[:n] // TODO: use buf somewhere } - -// func layout(tui *gocui.Gui) error { -// // w, h := tui.Size() -// return nil -// } |