mirror of https://github.com/chzyer/readline.git
add SetChildren for prefix completer interface
This commit is contained in:
parent
b57eccfd02
commit
3138d3552b
|
@ -12,6 +12,7 @@ type PrefixCompleterInterface interface {
|
||||||
Do(line []rune, pos int) (newLine [][]rune, length int)
|
Do(line []rune, pos int) (newLine [][]rune, length int)
|
||||||
GetName() []rune
|
GetName() []rune
|
||||||
GetChildren() []PrefixCompleterInterface
|
GetChildren() []PrefixCompleterInterface
|
||||||
|
SetChildren(children []PrefixCompleterInterface)
|
||||||
}
|
}
|
||||||
|
|
||||||
type PrefixCompleter struct {
|
type PrefixCompleter struct {
|
||||||
|
@ -53,6 +54,10 @@ func (p *PrefixCompleter) GetChildren() []PrefixCompleterInterface {
|
||||||
return p.Children
|
return p.Children
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (p *PrefixCompleter) SetChildren(children []PrefixCompleterInterface) {
|
||||||
|
p.Children = children
|
||||||
|
}
|
||||||
|
|
||||||
func NewPrefixCompleter(pc ...PrefixCompleterInterface) *PrefixCompleter {
|
func NewPrefixCompleter(pc ...PrefixCompleterInterface) *PrefixCompleter {
|
||||||
return PcItem("", pc...)
|
return PcItem("", pc...)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue