mirror of
https://github.com/jesseduffield/lazygit.git
synced 2026-10-05 21:46:49 -04:00
Remove the hint about hunk selection being the default
The hint was raised on entering the staging panel, once, to explain that the selection mode there had changed and how to get the old one back. That panel is gone, and with it the moment the hint was tied to; what is left is a string nothing prints and a flag nothing reads. The advice it carried is not lost: the option it names is documented, and the key that switches modes is on screen while a diff is focused. Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
352783ca1a
commit
4a5b599202
@@ -152,9 +152,6 @@ func Start(buildInfo *BuildInfo, integrationTest integrationTypes.IntegrationTes
|
||||
|
||||
if integrationTest != nil {
|
||||
integrationTest.SetupConfig(appConfig)
|
||||
// Set this to true so that integration tests don't have to explicitly deal with the hunk
|
||||
// staging hint:
|
||||
appConfig.GetAppState().DidShowHunkStagingHint = true
|
||||
|
||||
// Preserve the changes that the test setup just made to the config, so
|
||||
// they don't get lost when we reload the config while running the test
|
||||
|
||||
@@ -898,11 +898,10 @@ func (c *AppConfig) SaveGlobalUserConfig() {
|
||||
// AppState stores data between runs of the app like when the last update check
|
||||
// was performed and which other repos have been checked out
|
||||
type AppState struct {
|
||||
LastUpdateCheck int64
|
||||
RecentRepos []string
|
||||
StartupPopupVersion int
|
||||
DidShowHunkStagingHint bool
|
||||
LastVersion string // this is the last version the user was using, for the purpose of showing release notes
|
||||
LastUpdateCheck int64
|
||||
RecentRepos []string
|
||||
StartupPopupVersion int
|
||||
LastVersion string // this is the last version the user was using, for the purpose of showing release notes
|
||||
|
||||
// these are for shell commands typed in directly, not for custom commands in the lazygit config.
|
||||
// For backwards compatibility we keep the old name in yaml files.
|
||||
|
||||
@@ -587,7 +587,6 @@ func (self *CommitFilesController) enterCommitFile(node *filetree.CommitFileNode
|
||||
}
|
||||
|
||||
self.c.Context().Push(self.c.Contexts().CustomPatchBuilder, opts)
|
||||
self.c.Helpers().PatchBuilding.ShowHunkStagingHint()
|
||||
|
||||
return nil
|
||||
},
|
||||
|
||||
@@ -741,7 +741,6 @@ func (self *FilesController) EnterFile(opts types.OnFocusOpts) error {
|
||||
|
||||
context := lo.Ternary(opts.ClickedWindowName == "secondary", self.c.Contexts().StagingSecondary, self.c.Contexts().Staging)
|
||||
self.c.Context().Push(context, opts)
|
||||
self.c.Helpers().PatchBuilding.ShowHunkStagingHint()
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
package helpers
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/jesseduffield/lazygit/pkg/commands/git_commands"
|
||||
|
||||
"github.com/jesseduffield/lazygit/pkg/commands/patch"
|
||||
@@ -22,18 +20,6 @@ func NewPatchBuildingHelper(
|
||||
}
|
||||
}
|
||||
|
||||
func (self *PatchBuildingHelper) ShowHunkStagingHint() {
|
||||
if !self.c.AppState.DidShowHunkStagingHint && self.c.UserConfig().Gui.UseHunkModeInStagingView {
|
||||
self.c.AppState.DidShowHunkStagingHint = true
|
||||
self.c.SaveAppStateAndLogError()
|
||||
|
||||
message := fmt.Sprintf(self.c.Tr.HunkStagingHint, self.c.UserConfig().Keybinding.Main.ToggleSelectHunk)
|
||||
self.c.Confirm(types.ConfirmOpts{
|
||||
Prompt: message,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// takes us from the patch building panel back to the commit files panel
|
||||
func (self *PatchBuildingHelper) Escape() {
|
||||
self.c.Context().Pop()
|
||||
|
||||
@@ -313,7 +313,6 @@ type TranslationSet struct {
|
||||
NothingToSelectInDiff string
|
||||
SelectLineByLine string
|
||||
ToggleSelectHunkTooltip string
|
||||
HunkStagingHint string
|
||||
ToggleSelectionForPatch string
|
||||
RemoveSelectionFromPatch string
|
||||
RemoveSelectionFromPatchTooltip string
|
||||
@@ -1186,15 +1185,6 @@ const englishNonReloadableConfigWarning = `The following config settings were ch
|
||||
|
||||
{{configs}}`
|
||||
|
||||
const englishHunkStagingHint = `Hunk selection mode is now the default for staging. If you want to stage individual lines, press '%s' to switch to line-by-line mode.
|
||||
|
||||
If you prefer to use line-by-line mode by default (like in earlier lazygit versions), add
|
||||
|
||||
gui:
|
||||
useHunkModeInStagingView: false
|
||||
|
||||
to your lazygit config.`
|
||||
|
||||
// exporting this so we can use it in tests
|
||||
func EnglishTranslationSet() *TranslationSet {
|
||||
return &TranslationSet{
|
||||
@@ -1503,7 +1493,6 @@ func EnglishTranslationSet() *TranslationSet {
|
||||
SelectHunk: "Select hunks",
|
||||
SelectLineByLine: "Select line-by-line",
|
||||
ToggleSelectHunkTooltip: "Toggle line-by-line vs. hunk selection mode.",
|
||||
HunkStagingHint: englishHunkStagingHint,
|
||||
ToggleSelectionForPatch: `Toggle lines in patch`,
|
||||
RemoveSelectionFromPatch: `Remove lines from commit`,
|
||||
RemoveSelectionFromPatchTooltip: "Remove the selected lines from this commit. This runs an interactive rebase in the background, so you may get a merge conflict if a later commit also changes these lines.",
|
||||
|
||||
Reference in New Issue
Block a user