selected returns the currently highlighted item, or "" when the filtered list is empty.
()
| 84 | // selected returns the currently highlighted item, or "" when the |
| 85 | // filtered list is empty. |
| 86 | func (s pickerStep) selected() string { |
| 87 | v := s.filtered() |
| 88 | if len(v) == 0 { |
| 89 | return "" |
| 90 | } |
| 91 | return v[s.cursor] |
| 92 | } |
| 93 | |
| 94 | func (s pickerStep) view() string { |
| 95 | var b strings.Builder |