Skip to content

Commit

Permalink
Fix non-described completions when secondary
Browse files Browse the repository at this point in the history
  • Loading branch information
maxlandon committed Aug 27, 2023
1 parent 77dc70d commit 28d4fe7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions internal/completion/group.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ import (
"strconv"
"strings"

"golang.org/x/exp/slices"

"github.com/reeflective/readline/internal/color"
"github.com/reeflective/readline/internal/term"
"golang.org/x/exp/slices"
)

// group is used to structure different types of completions with different
Expand Down Expand Up @@ -398,7 +399,7 @@ func (g *group) trimDesc(val Candidate, pad int) (desc, padded string) {

func (g *group) getPad(value Candidate, columnIndex int, desc bool) int {
columns := g.columnsWidth
var valLen = value.displayLen - 1
valLen := value.displayLen - 1

if desc {
columns = g.descriptionsWidth
Expand Down
2 changes: 1 addition & 1 deletion internal/completion/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ func (e *Engine) generateGroup(comps Values) func(tag string, values RawValues)
// If we have a remaining group of values without descriptions,
// we will print and use them in a separate, anonymous group.
if len(noDescVals) > 0 {
e.newCompletionGroup(comps, "", vals, descriptions)
e.newCompletionGroup(comps, "", noDescVals, descriptions)
}
}
}
Expand Down

0 comments on commit 28d4fe7

Please sign in to comment.