Merge pull request #158 from UiP9AV6Y/feature-initial-text

add support for managing the initial buffer content.
This commit is contained in:
Masashi SHIBATA 2020-02-28 12:19:16 +09:00 committed by GitHub
commit 768273a734
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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 {