mirror of
https://github.com/sst/opencode.git
synced 2025-08-04 13:30:52 +00:00
tweak: remove needless resorting (#1116)
This commit is contained in:
parent
edfea03917
commit
571aeaaea2
1 changed files with 6 additions and 2 deletions
|
@ -67,6 +67,7 @@ func (c *completionDialogComponent) Init() tea.Cmd {
|
|||
func (c *completionDialogComponent) getAllCompletions(query string) tea.Cmd {
|
||||
return func() tea.Msg {
|
||||
allItems := make([]completions.CompletionSuggestion, 0)
|
||||
providersWithResults := 0
|
||||
|
||||
// Collect results from all providers
|
||||
for _, provider := range c.providers {
|
||||
|
@ -81,11 +82,14 @@ func (c *completionDialogComponent) getAllCompletions(query string) tea.Cmd {
|
|||
)
|
||||
continue
|
||||
}
|
||||
allItems = append(allItems, items...)
|
||||
if len(items) > 0 {
|
||||
providersWithResults++
|
||||
allItems = append(allItems, items...)
|
||||
}
|
||||
}
|
||||
|
||||
// If there's a query, use fuzzy ranking to sort results
|
||||
if query != "" && len(allItems) > 0 && len(c.providers) > 1 {
|
||||
if query != "" && providersWithResults > 1 {
|
||||
t := theme.CurrentTheme()
|
||||
baseStyle := styles.NewStyle().Background(t.BackgroundElement())
|
||||
// Create a slice of display values for fuzzy matching
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue