(o msOption, cursor, selected bool)
| 337 | } |
| 338 | |
| 339 | func (m *multiSelectSearchField) renderOption(o msOption, cursor, selected bool) string { |
| 340 | styles := m.activeStyles() |
| 341 | |
| 342 | var parts []string |
| 343 | if cursor { |
| 344 | parts = append(parts, styles.MultiSelectSelector.String()) |
| 345 | } else { |
| 346 | parts = append(parts, strings.Repeat(" ", lipgloss.Width(styles.MultiSelectSelector.String()))) |
| 347 | } |
| 348 | if selected { |
| 349 | parts = append(parts, styles.SelectedPrefix.String()) |
| 350 | parts = append(parts, styles.SelectedOption.Render(o.label)) |
| 351 | } else { |
| 352 | parts = append(parts, styles.UnselectedPrefix.String()) |
| 353 | parts = append(parts, styles.UnselectedOption.Render(o.label)) |
| 354 | } |
| 355 | return lipgloss.JoinHorizontal(lipgloss.Left, parts...) |
| 356 | } |
| 357 | |
| 358 | func (m *multiSelectSearchField) activeStyles() *huh.FieldStyles { |
| 359 | theme := m.theme |
no test coverage detected