Fix title option
This commit is contained in:
parent
afa85b3f5c
commit
d94b119cd7
|
@ -20,7 +20,7 @@ func WriterOption(x ConsoleWriter) option {
|
|||
|
||||
func TitleOption(x string) option {
|
||||
return func(p *Prompt) error {
|
||||
p.title = x
|
||||
p.renderer.title = x
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
@ -54,7 +54,6 @@ func NewPrompt(executor Executor, completer Completer, opts ...option) *Prompt {
|
|||
prefixColor: "green",
|
||||
out: &VT100Writer{fd: syscall.Stdout},
|
||||
},
|
||||
title: "",
|
||||
buf: NewBuffer(),
|
||||
executor: executor,
|
||||
completer: completer,
|
||||
|
|
|
@ -14,7 +14,6 @@ type Prompt struct {
|
|||
in ConsoleParser
|
||||
buf *Buffer
|
||||
renderer *Render
|
||||
title string
|
||||
executor Executor
|
||||
completer Completer
|
||||
chosen int // -1 means nothing one is chosen.
|
||||
|
|
|
@ -3,7 +3,7 @@ package prompt
|
|||
type Render struct {
|
||||
prefix string
|
||||
prefixColor string
|
||||
Title string
|
||||
title string
|
||||
out ConsoleWriter
|
||||
row uint16
|
||||
col uint16
|
||||
|
@ -11,8 +11,8 @@ type Render struct {
|
|||
}
|
||||
|
||||
func (r *Render) Setup() {
|
||||
if r.Title != "" {
|
||||
r.out.SetTitle(r.Title)
|
||||
if r.title != "" {
|
||||
r.out.SetTitle(r.title)
|
||||
}
|
||||
r.renderPrefix()
|
||||
r.out.Flush()
|
||||
|
|
Loading…
Reference in New Issue