diff --git a/pkg/cmdrunner/cmdrunner.go b/pkg/cmdrunner/cmdrunner.go index d5c3eed4..22cc3471 100644 --- a/pkg/cmdrunner/cmdrunner.go +++ b/pkg/cmdrunner/cmdrunner.go @@ -480,9 +480,9 @@ func makeInfoFromComps(compType string, comps []string, hasMore bool) sstore.Upd sort.Strings(comps) update := sstore.InfoUpdate{ Info: &sstore.InfoMsgType{ - InfoTitle: fmt.Sprintf("%s completions", compType), - InfoStrings: comps, - InfoStringsMore: hasMore, + InfoTitle: fmt.Sprintf("%s completions", compType), + InfoComps: comps, + InfoCompsMore: hasMore, }, } return update @@ -508,6 +508,9 @@ func longestPrefix(root string, comps []string) string { if len(comps) == 1 { comp := comps[0] if len(comp) >= len(root) && strings.HasPrefix(comp, root) { + if strings.HasSuffix(comp, "/") { + return comps[0] + } return comps[0] + " " } } diff --git a/pkg/sstore/updatebus.go b/pkg/sstore/updatebus.go index 9a969148..62a1f4ea 100644 --- a/pkg/sstore/updatebus.go +++ b/pkg/sstore/updatebus.go @@ -75,12 +75,12 @@ func (LineUpdate) UpdateType() string { } type InfoMsgType struct { - InfoTitle string `json:"infotitle"` - InfoError string `json:"infoerror,omitempty"` - InfoMsg string `json:"infomsg,omitempty"` - InfoStrings []string `json:"infostrings"` - InfoStringsMore bool `json:"infostringsmore"` - TimeoutMs int64 `json:"timeoutms,omitempty"` + InfoTitle string `json:"infotitle"` + InfoError string `json:"infoerror,omitempty"` + InfoMsg string `json:"infomsg,omitempty"` + InfoComps []string `json:"infocomps"` + InfoCompsMore bool `json:"infocompssmore"` + TimeoutMs int64 `json:"timeoutms,omitempty"` } type CmdLineType struct {