summaryrefslogtreecommitdiffstats
path: root/pkg/gui/layout.go
diff options
context:
space:
mode:
authorStefan Haller <stefan@haller-berlin.de>2023-05-06 14:02:14 +0200
committerStefan Haller <stefan@haller-berlin.de>2023-05-11 13:23:58 +0200
commite5dd4d311064c2b45dfe3f08a2a4cbf4536404cc (patch)
tree774b5ece77ccd4eacb3fd2223560f7d92e136610 /pkg/gui/layout.go
parent595c7ee73e9d2053fc1cb4ca0b6fd1274852ee9a (diff)
Allow the selected line of a list view to be outside the visible area
I don't see a reason why this restriction to have the selection be always visible was necessary. Removing it has two benefits: 1. Scrolling a list view doesn't change the selection. A common scenario: you look at one of the commits of your current branch; you want to see the how many'th commit this is, but the beginning of the branch is scrolled off the bottom of the commits panel. You scroll down to find the beginning of your branch, but this changes the selection and shows a different commit now - not what you want. 2. It is possible to scroll a panel that is not the current one without changing the focus to it. That's how windows in other GUIs usually behave.
Diffstat (limited to 'pkg/gui/layout.go')
-rw-r--r--pkg/gui/layout.go2
1 files changed, 0 insertions, 2 deletions
diff --git a/pkg/gui/layout.go b/pkg/gui/layout.go
index 5b3e6845f..35dbe55b7 100644
--- a/pkg/gui/layout.go
+++ b/pkg/gui/layout.go
@@ -131,8 +131,6 @@ func (gui *Gui) layout(g *gocui.Gui) error {
continue
}
- listContext.FocusLine()
-
view.SelBgColor = theme.GocuiSelectedLineBgColor
// I doubt this is expensive though it's admittedly redundant after the first render