2020-11-28 13:14:48 +11:00
|
|
|
package gui
|
|
|
|
|
2020-11-28 20:01:45 +11:00
|
|
|
import (
|
|
|
|
"github.com/jesseduffield/lazygit/pkg/gui/types"
|
|
|
|
)
|
2020-11-28 19:53:39 +11:00
|
|
|
|
|
|
|
func (gui *Gui) getSelectedSuggestionValue() string {
|
|
|
|
selectedSuggestion := gui.getSelectedSuggestion()
|
|
|
|
|
|
|
|
if selectedSuggestion != nil {
|
|
|
|
return selectedSuggestion.Value
|
|
|
|
}
|
|
|
|
|
|
|
|
return ""
|
|
|
|
}
|
|
|
|
|
|
|
|
func (gui *Gui) getSelectedSuggestion() *types.Suggestion {
|
2022-02-05 17:04:10 +11:00
|
|
|
return gui.State.Contexts.Suggestions.GetSelected()
|
2020-11-28 13:14:48 +11:00
|
|
|
}
|
|
|
|
|
2020-11-28 19:53:39 +11:00
|
|
|
func (gui *Gui) setSuggestions(suggestions []*types.Suggestion) {
|
2020-11-28 13:14:48 +11:00
|
|
|
gui.State.Suggestions = suggestions
|
2022-02-05 17:04:10 +11:00
|
|
|
gui.State.Contexts.Suggestions.SetSelectedLineIdx(0)
|
2021-04-04 23:51:59 +10:00
|
|
|
_ = gui.resetOrigin(gui.Views.Suggestions)
|
2021-04-03 15:56:11 +11:00
|
|
|
_ = gui.State.Contexts.Suggestions.HandleRender()
|
2020-11-28 13:14:48 +11:00
|
|
|
}
|