(o msOption, cursor, selected bool)
| 349 | } |
| 350 | |
| 351 | func (m *multiSelectSearchField) renderOption(o msOption, cursor, selected bool) string { |
| 352 | styles := m.activeStyles() |
| 353 | |
| 354 | var parts []string |
| 355 | if cursor { |
| 356 | parts = append(parts, styles.MultiSelectSelector.String()) |
| 357 | } else { |
| 358 | parts = append(parts, strings.Repeat(" ", lipgloss.Width(styles.MultiSelectSelector.String()))) |
| 359 | } |
| 360 | if selected { |
| 361 | parts = append(parts, styles.SelectedPrefix.String()) |
| 362 | parts = append(parts, styles.SelectedOption.Render(o.label)) |
| 363 | } else { |
| 364 | parts = append(parts, styles.UnselectedPrefix.String()) |
| 365 | parts = append(parts, styles.UnselectedOption.Render(o.label)) |
| 366 | } |
| 367 | return lipgloss.JoinHorizontal(lipgloss.Left, parts...) |
| 368 | } |
| 369 | |
| 370 | func (m *multiSelectSearchField) activeStyles() *huh.FieldStyles { |
| 371 | theme := m.theme |
no test coverage detected