Remove common prefix for bash as well

This commit is contained in:
Kovid Goyal
2022-09-19 17:09:42 +05:30
parent a7c997c6ef
commit b04b483b3f
3 changed files with 28 additions and 18 deletions

View File

@@ -14,6 +14,7 @@ var _ = fmt.Print
func bash_output_serializer(completions []*Completions, shell_state map[string]string) ([]byte, error) {
output := strings.Builder{}
for _, mg := range completions[0].Groups {
mg.remove_common_prefix()
for _, m := range mg.Matches {
fmt.Fprintln(&output, "COMPREPLY+=("+utils.QuoteStringForSH(m.Word)+")")
}