(key string)
| 200 | ) |
| 201 | |
| 202 | func (v *PricingView) HandleKey(key string) PricingEvent { |
| 203 | if key == "f2" { |
| 204 | v.CommandBuilder = NewCommandBuilderState() |
| 205 | v.BuilderFocus = BuilderFocusField |
| 206 | v.SuggestionsCache = nil |
| 207 | v.SuggestionIndex = -1 |
| 208 | v.SuggestionScroll = 0 |
| 209 | v.FilterItems() |
| 210 | if v.ActiveSection == PricingSectionCommand { |
| 211 | v.UpdateSuggestions() |
| 212 | } |
| 213 | return PricingEventNone |
| 214 | } |
| 215 | |
| 216 | switch v.ActiveSection { |
| 217 | case PricingSectionHeader: |
| 218 | return v.handleKeyHeader(key) |
| 219 | case PricingSectionCommand: |
| 220 | return v.handleKeyCommand(key) |
| 221 | case PricingSectionResults: |
| 222 | return v.handleKeyResults(key) |
| 223 | } |
| 224 | return PricingEventNone |
| 225 | } |
| 226 | |
| 227 | func (v *PricingView) handleKeyHeader(key string) PricingEvent { |
| 228 | switch key { |
nothing calls this directly
no test coverage detected