add support for managing the initial buffer content.

the option will modify the buffer content upon startup and works
in combination with `OptionShowCompletionAtStart()`.
This commit is contained in:
Gordon Bleux 2020-02-27 19:01:43 +01:00
parent 3a148d1647
commit 715666277d

View File

@ -37,6 +37,14 @@ func OptionPrefix(x string) Option {
}
}
// OptionInitialBufferText to set the initial buffer text
func OptionInitialBufferText(x string) Option {
return func(p *Prompt) error {
p.buf.InsertText(x, false, true)
return nil
}
}
// OptionCompletionWordSeparator to set word separators. Enable only ' ' if empty.
func OptionCompletionWordSeparator(x string) Option {
return func(p *Prompt) error {