src

Go monorepo.
Log | Files | Refs

commit 458fcc3cefa22c4682537ce76d3e50a02747b9a7
parent 501ec358e270f734a4026a8ed57ac0e77f45815e
Author: dwrz <dwrz@dwrz.net>
Date:   Sat, 28 Jan 2023 01:24:52 +0000

Refactor prompt

Diffstat:
Mpkg/editor/prompt/prompt.go | 6------
1 file changed, 0 insertions(+), 6 deletions(-)

diff --git a/pkg/editor/prompt/prompt.go b/pkg/editor/prompt/prompt.go @@ -2,7 +2,6 @@ package prompt import ( "fmt" - "sync" "unicode" "unicode/utf8" @@ -14,7 +13,6 @@ import ( type Prompt struct { log *log.Logger - mu sync.Mutex err error cb CB cursor cursor @@ -29,8 +27,6 @@ type cursor struct { index int } -var NoOp CB = func(l line.Line) error { return nil } - type Parameters struct { Log *log.Logger } @@ -60,7 +56,6 @@ func (p *Prompt) Cursor() int { } func (p *Prompt) Escape() { - // No error -- we should be done. p.cb = nil p.err = nil p.line = nil @@ -80,7 +75,6 @@ func (p *Prompt) Prompt(s string, cb CB) { p.log.Debug.Printf("new prompt: %#v", p) } -// TODO: mutex? Channel? Better canvas library? func (p *Prompt) SetText(s string) { p.text = s }