diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2022-02-05 17:04:10 +1100 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2022-03-17 19:13:40 +1100 |
commit | d82f175e79f18756769d91de94458b095130297c (patch) | |
tree | 63c0c5b17a698a5a202a85b930edd0cf9e85ebf7 /pkg/gui/suggestions_panel.go | |
parent | 145c69d9ae32ec8fbdd6d1e6116efec466a0a709 (diff) |
refactor contexts
Diffstat (limited to 'pkg/gui/suggestions_panel.go')
-rw-r--r-- | pkg/gui/suggestions_panel.go | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/pkg/gui/suggestions_panel.go b/pkg/gui/suggestions_panel.go index c11145ded..d7b8b0d2b 100644 --- a/pkg/gui/suggestions_panel.go +++ b/pkg/gui/suggestions_panel.go @@ -15,17 +15,12 @@ func (gui *Gui) getSelectedSuggestionValue() string { } func (gui *Gui) getSelectedSuggestion() *types.Suggestion { - selectedLine := gui.State.Panels.Suggestions.SelectedLineIdx - if selectedLine == -1 { - return nil - } - - return gui.State.Suggestions[selectedLine] + return gui.State.Contexts.Suggestions.GetSelected() } func (gui *Gui) setSuggestions(suggestions []*types.Suggestion) { gui.State.Suggestions = suggestions - gui.State.Panels.Suggestions.SelectedLineIdx = 0 + gui.State.Contexts.Suggestions.SetSelectedLineIdx(0) _ = gui.resetOrigin(gui.Views.Suggestions) _ = gui.State.Contexts.Suggestions.HandleRender() } |