1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2024-12-14 11:23:09 +02:00
lazygit/pkg/gui/suggestions_panel.go

27 lines
635 B
Go
Raw Normal View History

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