Update some options for pagination
This commit is contained in:
parent
710a2b89af
commit
bd11e00806
|
@ -65,6 +65,8 @@ It is difficult to describe by text. So please see below figure:
|
|||
* **OptionDescriptionBGColor(prompt.Color)** : default `prompt.Turquoise`
|
||||
* **OptionSelectedDescriptionTextColor(prompt.Color)** : default `prompt.White`
|
||||
* **OptionSelectedDescriptionBGColor(prompt.Color)** : default `prompt.Cyan`
|
||||
* **OptionScrollbarThumbColor** : `prompt.DarkGray`
|
||||
* **OptionScrollbarBGColor** : `prompt.Cyan`
|
||||
|
||||
**Other Options**
|
||||
|
||||
|
@ -77,6 +79,9 @@ Option to set history.
|
|||
#### `OptionPrefix(string)` : default `"> "`
|
||||
Option to set prefix string.
|
||||
|
||||
#### `OptionLivePrefix(func() (prefix string, useLivePrefix bool))` : default `nil`
|
||||
Option to set a callback function for updating prefix string dynamically.
|
||||
|
||||
#### `OptionMaxSuggestions(x uint16)` : default `6`
|
||||
The max number of displayed suggestions.
|
||||
|
||||
|
|
14
option.go
14
option.go
|
@ -142,6 +142,20 @@ func OptionSelectedDescriptionBGColor(x Color) Option {
|
|||
}
|
||||
}
|
||||
|
||||
func OptionScrollbarThumbColor(x Color) Option {
|
||||
return func(p *Prompt) error {
|
||||
p.renderer.scrollbarThumbColor = x
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
func OptionScrollbarBGColor(x Color) Option {
|
||||
return func(p *Prompt) error {
|
||||
p.renderer.scrollbarBGColor = x
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
// OptionMaxSuggestion specify the max number of displayed suggestions.
|
||||
func OptionMaxSuggestion(x uint16) Option {
|
||||
return func(p *Prompt) error {
|
||||
|
|
Loading…
Reference in New Issue