vendor: fix issue in readline option selector
Signed-off-by: Rohit Yadav <rohit@apache.org>
diff --git a/vendor/github.com/chzyer/readline/complete.go b/vendor/github.com/chzyer/readline/complete.go
index 9d19fa5..9ea15d2 100644
--- a/vendor/github.com/chzyer/readline/complete.go
+++ b/vendor/github.com/chzyer/readline/complete.go
@@ -47,13 +47,18 @@
}
func (o *opCompleter) writeRunes(candidate []rune) {
- lastIndex := len(candidate)
+ detailIndex := len(candidate)
+ spaceFound := false
for idx, r := range candidate {
- if r == '(' {
- lastIndex = idx
+ if r == ' ' {
+ spaceFound = true
+ }
+ if spaceFound && r == '(' {
+ detailIndex = idx
+ break
}
}
- o.op.buf.WriteRunes(candidate[:lastIndex])
+ o.op.buf.WriteRunes(candidate[:detailIndex])
}
func (o *opCompleter) doSelect() {