(optionText string)
| 339 | } |
| 340 | |
| 341 | func (p *InteractiveMultiselectPrinter) selectOption(optionText string) { |
| 342 | idx := p.findOptionByText(optionText) |
| 343 | if idx < 0 { |
| 344 | return |
| 345 | } |
| 346 | |
| 347 | if p.isSelected(optionText) { |
| 348 | // Remove from selected options |
| 349 | for i, selectedOption := range p.selectedOptions { |
| 350 | if p.Options[selectedOption] == optionText { |
| 351 | p.selectedOptions = append(p.selectedOptions[:i], p.selectedOptions[i+1:]...) |
| 352 | break |
| 353 | } |
| 354 | } |
| 355 | } else { |
| 356 | // Add to selected options |
| 357 | p.selectedOptions = append(p.selectedOptions, idx) |
| 358 | } |
| 359 | } |
| 360 | |
| 361 | func (p *InteractiveMultiselectPrinter) renderSelectMenu() string { |
| 362 | var content strings.Builder |
no test coverage detected