summaryrefslogtreecommitdiffstats
path: root/pkg/gui/layout.go
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2024-01-14 00:18:05 +1100
committerJesse Duffield <jessedduffield@gmail.com>2024-01-19 10:47:21 +1100
commitf3eb180f75496637719895902abf76af10b8425f (patch)
tree2734dec7d15d35e8c4ff1b65aa3d722cdbd69ac5 /pkg/gui/layout.go
parentc0c3aac02e048903764e4b42b513334e58855d73 (diff)
Standardise display of range selection across views
We're not fully standardising here: different contexts can store their range state however they like. What we are standardising on is that now the view is always responsible for highlighting the selected lines, meaning the context/controller needs to tell the view where the range start is. Two convenient benefits from this change: 1) we no longer need bespoke code in integration tests for asserting on selected lines because we can just ask the view 2) line selection in staging/patch-building/merge-conflicts views now look the same as in list views i.e. the highlight applies to the whole line (including trailing space) I also noticed a bug with merge conflicts not rendering the selection on focus though I suspect it wasn't a bug with any real consequences when the view wasn't displaying the selection. I'm going to scrap the selectedRangeBgColor config and just let it use the single line background color. Hopefully nobody cares, but there's really no need for an extra config.
Diffstat (limited to 'pkg/gui/layout.go')
-rw-r--r--pkg/gui/layout.go10
1 files changed, 0 insertions, 10 deletions
diff --git a/pkg/gui/layout.go b/pkg/gui/layout.go
index 7b43f8aaa..02c74b023 100644
--- a/pkg/gui/layout.go
+++ b/pkg/gui/layout.go
@@ -4,7 +4,6 @@ import (
"github.com/jesseduffield/gocui"
"github.com/jesseduffield/lazygit/pkg/gui/context"
"github.com/jesseduffield/lazygit/pkg/gui/types"
- "github.com/jesseduffield/lazygit/pkg/theme"
"github.com/samber/lo"
"golang.org/x/exp/slices"
)
@@ -143,15 +142,6 @@ func (gui *Gui) layout(g *gocui.Gui) error {
gui.State.ViewsSetup = true
}
- for _, listContext := range gui.c.Context().AllList() {
- view, err := gui.g.View(listContext.GetViewName())
- if err != nil {
- continue
- }
-
- view.SelBgColor = theme.GocuiSelectedLineBgColor
- }
-
mainViewWidth, mainViewHeight := gui.Views.Main.Size()
if mainViewWidth != gui.PrevLayout.MainWidth || mainViewHeight != gui.PrevLayout.MainHeight {
gui.PrevLayout.MainWidth = mainViewWidth