Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions pkg/gui/layout.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package gui

import (
"errors"
"strings"

"github.com/jesseduffield/gocui"
"github.com/jesseduffield/lazygit/pkg/gui/types"
Expand Down Expand Up @@ -257,6 +258,8 @@ func (gui *Gui) onInitialViewsCreation() error {
}
}

gui.checkForDeltaNavigateWarning()

gui.c.GetAppState().LastVersion = gui.Config.GetVersion()
gui.c.SaveAppStateAndLogError()

Expand All @@ -274,6 +277,21 @@ func (gui *Gui) onInitialViewsCreation() error {
return nil
}

func (gui *Gui) checkForDeltaNavigateWarning() {
userConfig := gui.c.UserConfig()
for _, pagerConfig := range userConfig.Git.Pagers {
pagerCmd := string(pagerConfig.Pager)
if strings.Contains(pagerCmd, "delta") && strings.Contains(pagerCmd, "--navigate") {
gui.c.Log.Warn("Configuration warning: 'delta --navigate' detected. This flag is not supported in lazygit as it requires interactive input that lazygit cannot forward to the pager subprocess.")
gui.c.OnUIThread(func() error {
gui.c.Alert(gui.c.Tr.DeltaNavigateWarningTitle, gui.c.Tr.DeltaNavigateWarning)
return nil
})
return
}
}
}

func (gui *Gui) transientContexts() []types.Context {
return lo.Filter(gui.State.Contexts.Flatten(), func(context types.Context, _ int) bool {
return context.IsTransient()
Expand Down
4 changes: 4 additions & 0 deletions pkg/i18n/english.go
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,8 @@ type TranslationSet struct {
IntroPopupMessage string
NonReloadableConfigWarningTitle string
NonReloadableConfigWarning string
DeltaNavigateWarningTitle string
DeltaNavigateWarning string
GitconfigParseErr string
EditFile string
EditFileTooltip string
Expand Down Expand Up @@ -1344,6 +1346,8 @@ func EnglishTranslationSet() *TranslationSet {
IntroPopupMessage: englishIntroPopupMessage,
NonReloadableConfigWarningTitle: "Config changed",
NonReloadableConfigWarning: englishNonReloadableConfigWarning,
DeltaNavigateWarningTitle: "Delta --navigate Not Supported",
DeltaNavigateWarning: "You have 'delta --navigate' configured as your pager.\n\nThe --navigate flag requires interactive keyboard input (n/N keys) that lazygit cannot forward to the subprocess.\n\nPlease remove '--navigate' from your pager configuration.",
GitconfigParseErr: `Gogit failed to parse your gitconfig file due to the presence of unquoted '\' characters. Removing these should fix the issue.`,
EditFile: `Edit file`,
EditFileTooltip: "Open file in external editor.",
Expand Down