()
| 124 | } |
| 125 | |
| 126 | func (s pickerStep) visibleWindow() ([]string, int) { |
| 127 | out := s.filtered() |
| 128 | if s.visibleLimit <= 0 || len(out) <= s.visibleLimit { |
| 129 | return out, 0 |
| 130 | } |
| 131 | start := s.cursor - s.visibleLimit + 1 |
| 132 | if start < 0 { |
| 133 | start = 0 |
| 134 | } |
| 135 | end := start + s.visibleLimit |
| 136 | if end > len(out) { |
| 137 | end = len(out) |
| 138 | } |
| 139 | return out[start:end], start |
| 140 | } |
| 141 | |
| 142 | func (s pickerStep) filtered() []string { |
| 143 | if s.filter == "" { |