summaryrefslogtreecommitdiffstats
path: root/pkg/gui/view_helpers.go
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2022-02-13 10:48:41 +1100
committerJesse Duffield <jessedduffield@gmail.com>2022-03-17 19:13:40 +1100
commit41527270ed9270ef6c463866e9c761f2285af857 (patch)
treeb46231e732b100701f82acbea7269d8e76f2dd07 /pkg/gui/view_helpers.go
parent3188526ecb1e48327249a830173de7ab5ce5978a (diff)
appease linter
Diffstat (limited to 'pkg/gui/view_helpers.go')
-rw-r--r--pkg/gui/view_helpers.go60
1 files changed, 0 insertions, 60 deletions
diff --git a/pkg/gui/view_helpers.go b/pkg/gui/view_helpers.go
index 202504c10..234be7a4c 100644
--- a/pkg/gui/view_helpers.go
+++ b/pkg/gui/view_helpers.go
@@ -2,19 +2,12 @@ package gui
import (
"fmt"
- "sort"
- "strings"
"github.com/jesseduffield/gocui"
- "github.com/jesseduffield/lazygit/pkg/gui/types"
"github.com/jesseduffield/lazygit/pkg/utils"
"github.com/spkg/bom"
)
-func (gui *Gui) getCyclableWindows() []string {
- return []string{"status", "files", "branches", "commits", "stash"}
-}
-
func (gui *Gui) resetOrigin(v *gocui.View) error {
_ = v.SetCursor(0, 0)
return v.SetOrigin(0, 0)
@@ -41,19 +34,6 @@ func (gui *Gui) renderString(view *gocui.View, s string) error {
return nil
}
-func (gui *Gui) optionsMapToString(optionsMap map[string]string) string {
- optionsArray := make([]string, 0)
- for key, description := range optionsMap {
- optionsArray = append(optionsArray, key+": "+description)
- }
- sort.Strings(optionsArray)
- return strings.Join(optionsArray, ", ")
-}
-
-func (gui *Gui) renderOptionsMap(optionsMap map[string]string) {
- _ = gui.renderString(gui.Views.Options, gui.optionsMapToString(optionsMap))
-}
-
func (gui *Gui) currentViewName() string {
currentView := gui.g.CurrentView()
if currentView == nil {
@@ -85,46 +65,6 @@ func (gui *Gui) resizePopupPanel(v *gocui.View, content string) error {
return err
}
-func (gui *Gui) changeSelectedLine(panelState types.IListPanelState, total int, change int) {
- // TODO: find out why we're doing this
- line := panelState.GetSelectedLineIdx()
-
- if line == -1 {
- return
- }
- var newLine int
- if line+change < 0 {
- newLine = 0
- } else if line+change >= total {
- newLine = total - 1
- } else {
- newLine = line + change
- }
-
- panelState.SetSelectedLineIdx(newLine)
-}
-
-func (gui *Gui) refreshSelectedLine(panelState types.IListPanelState, total int) {
- line := panelState.GetSelectedLineIdx()
-
- if line == -1 && total > 0 {
- panelState.SetSelectedLineIdx(0)
- } else if total-1 < line {
- panelState.SetSelectedLineIdx(total - 1)
- }
-}
-
-func (gui *Gui) renderDisplayStrings(v *gocui.View, displayStrings [][]string) {
- list := utils.RenderDisplayStrings(displayStrings)
- v.SetContent(list)
-}
-
-func (gui *Gui) renderDisplayStringsInViewPort(v *gocui.View, displayStrings [][]string) {
- list := utils.RenderDisplayStrings(displayStrings)
- _, y := v.Origin()
- v.OverwriteLines(y, list)
-}
-
func (gui *Gui) globalOptionsMap() map[string]string {
keybindingConfig := gui.c.UserConfig.Keybinding