summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--docs/Config.md1
-rw-r--r--pkg/config/user_config.go2
-rw-r--r--pkg/gui/controllers/helpers/sub_commits_helper.go1
-rw-r--r--pkg/gui/controllers/remotes_controller.go1
-rw-r--r--pkg/gui/controllers/switch_to_diff_files_controller.go1
-rw-r--r--pkg/gui/views.go24
6 files changed, 30 insertions, 0 deletions
diff --git a/docs/Config.md b/docs/Config.md
index f23e6ccf0..0fc9df0d4 100644
--- a/docs/Config.md
+++ b/docs/Config.md
@@ -76,6 +76,7 @@ gui:
showRandomTip: true
showBranchCommitHash: false # show commit hashes alongside branch names
showBottomLine: true # for hiding the bottom information line (unless it has important information to tell you)
+ showPanelJumps: true # for showing the jump-to-panel keybindings as panel subtitles
showCommandLog: true
showIcons: false # deprecated: use nerdFontsVersion instead
nerdFontsVersion: "" # nerd fonts version to use ("2" or "3"); empty means don't show nerd font icons
diff --git a/pkg/config/user_config.go b/pkg/config/user_config.go
index 4df6b5676..17f4b4a1c 100644
--- a/pkg/config/user_config.go
+++ b/pkg/config/user_config.go
@@ -50,6 +50,7 @@ type GuiConfig struct {
ShowRandomTip bool `yaml:"showRandomTip"`
ShowCommandLog bool `yaml:"showCommandLog"`
ShowBottomLine bool `yaml:"showBottomLine"`
+ ShowPanelJumps bool `yaml:"showPanelJumps"`
ShowIcons bool `yaml:"showIcons"`
NerdFontsVersion string `yaml:"nerdFontsVersion"`
ShowBranchCommitHash bool `yaml:"showBranchCommitHash"`
@@ -456,6 +457,7 @@ func GetDefaultConfig() *UserConfig {
ShowListFooter: true,
ShowCommandLog: true,
ShowBottomLine: true,
+ ShowPanelJumps: true,
ShowFileTree: true,
ShowRandomTip: true,
ShowIcons: false,
diff --git a/pkg/gui/controllers/helpers/sub_commits_helper.go b/pkg/gui/controllers/helpers/sub_commits_helper.go
index 74c50fd14..7f5417cc3 100644
--- a/pkg/gui/controllers/helpers/sub_commits_helper.go
+++ b/pkg/gui/controllers/helpers/sub_commits_helper.go
@@ -63,6 +63,7 @@ func (self *SubCommitsHelper) ViewSubCommits(opts ViewSubCommitsOpts) error {
subCommitsContext.SetShowBranchHeads(opts.ShowBranchHeads)
subCommitsContext.ClearSearchString()
subCommitsContext.GetView().ClearSearch()
+ subCommitsContext.GetView().TitlePrefix = opts.Context.GetView().TitlePrefix
err = self.c.PostRefreshUpdate(self.c.Contexts().SubCommits)
if err != nil {
diff --git a/pkg/gui/controllers/remotes_controller.go b/pkg/gui/controllers/remotes_controller.go
index 56dc466c5..d0f643eec 100644
--- a/pkg/gui/controllers/remotes_controller.go
+++ b/pkg/gui/controllers/remotes_controller.go
@@ -109,6 +109,7 @@ func (self *RemotesController) enter(remote *models.Remote) error {
remoteBranchesContext.SetSelectedLineIdx(newSelectedLine)
remoteBranchesContext.SetTitleRef(remote.Name)
remoteBranchesContext.SetParentContext(self.Context())
+ remoteBranchesContext.GetView().TitlePrefix = self.Context().GetView().TitlePrefix
if err := self.c.PostRefreshUpdate(remoteBranchesContext); err != nil {
return err
diff --git a/pkg/gui/controllers/switch_to_diff_files_controller.go b/pkg/gui/controllers/switch_to_diff_files_controller.go
index 971efb7a1..7143a8805 100644
--- a/pkg/gui/controllers/switch_to_diff_files_controller.go
+++ b/pkg/gui/controllers/switch_to_diff_files_controller.go
@@ -84,6 +84,7 @@ func (self *SwitchToDiffFilesController) viewFiles(opts SwitchToCommitFilesConte
diffFilesContext.SetParentContext(opts.Context)
diffFilesContext.SetWindowName(opts.Context.GetWindowName())
diffFilesContext.ClearSearchString()
+ diffFilesContext.GetView().TitlePrefix = opts.Context.GetView().TitlePrefix
if err := self.c.Refresh(types.RefreshOptions{
Scope: []types.RefreshableView{types.COMMIT_FILES},
diff --git a/pkg/gui/views.go b/pkg/gui/views.go
index 327feb1bc..434cbd20f 100644
--- a/pkg/gui/views.go
+++ b/pkg/gui/views.go
@@ -1,6 +1,8 @@
package gui
import (
+ "fmt"
+
"github.com/jesseduffield/gocui"
"github.com/jesseduffield/lazygit/pkg/theme"
"github.com/samber/lo"
@@ -186,5 +188,27 @@ func (gui *Gui) createAllViews() error {
gui.Views.Snake.Title = gui.c.Tr.SnakeTitle
gui.Views.Snake.FgColor = gocui.ColorGreen
+ if gui.c.UserConfig.Gui.ShowPanelJumps {
+ jumpBindings := gui.c.UserConfig.Keybinding.Universal.JumpToBlock
+ jumpLabels := lo.Map(jumpBindings, func(binding string, _ int) string {
+ return fmt.Sprintf("[%s]", binding)
+ })
+
+ gui.Views.Status.TitlePrefix = jumpLabels[0]
+
+ gui.Views.Files.TitlePrefix = jumpLabels[1]
+ gui.Views.Worktrees.TitlePrefix = jumpLabels[1]
+ gui.Views.Submodules.TitlePrefix = jumpLabels[1]
+
+ gui.Views.Branches.TitlePrefix = jumpLabels[2]
+ gui.Views.Remotes.TitlePrefix = jumpLabels[2]
+ gui.Views.Tags.TitlePrefix = jumpLabels[2]
+
+ gui.Views.Commits.TitlePrefix = jumpLabels[3]
+ gui.Views.ReflogCommits.TitlePrefix = jumpLabels[3]
+
+ gui.Views.Stash.TitlePrefix = jumpLabels[4]
+ }
+
return nil
}