From dc97985c537a3ac6b9946867b22f6e2b17a8856a Mon Sep 17 00:00:00 2001 From: Stefan Haller Date: Thu, 20 Aug 2026 21:37:11 +0200 Subject: [PATCH] Document line actions in the focused diff Users no longer enter separate staging or patch-building panels. Describe file entry, pane switching, staging, and custom patch construction where those actions now happen, and remove the deleted package from the developer guide. Co-Authored-By: GitHub Copilot --- README.md | 4 ++-- docs-master/Config.md | 6 +++--- docs-master/dev/Codebase_Guide.md | 1 - pkg/config/user_config.go | 2 +- schema-master/config.json | 2 +- 5 files changed, 7 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 80d191bbf..aafd2768d 100644 --- a/README.md +++ b/README.md @@ -135,7 +135,7 @@ Lazygit is not my fulltime job but it is a hefty part time job so if you want to ### Stage individual lines -Press space on the selected line to stage it, or press `v` to start selecting a range of lines. You can also press `a` to select the entirety of the current hunk. +Press `` on a changed file to focus its diff in the main view. Press `` on the selected line to stage it, or press `v` to start selecting a range of lines. You can also press `a` to switch to hunk selection mode. When a file has both staged and unstaged changes, use `` to move between the two diff panes; the same actions stage or unstage the selection depending on the pane. ![stage_lines](../assets/demo/stage_lines-compressed.gif) @@ -195,7 +195,7 @@ You can create worktrees to have multiple branches going at once without the nee You can build a custom patch from an old commit and then remove the patch from the commit, split out a new commit, apply the patch in reverse to the index, and more. -In this example we have a redundant comment that we want to remove from an old commit. We hit `` on the commit to view its files, then `` on a file to focus the patch, then `` to add the comment line to our custom patch, and then `ctrl+p` to view the custom patch options; selecting to remove the patch from the current commit. +In this example we have a redundant comment that we want to remove from an old commit. We hit `` on the commit to view its files, then `` on a file to focus its diff. From there, `` adds the selected comment line to the custom patch and `ctrl+p` opens the custom patch options, where we choose to remove the patch from the original commit. Learn more in the [Rebase magic Youtube tutorial](https://youtu.be/4XaToVut_hs). diff --git a/docs-master/Config.md b/docs-master/Config.md index 803c11e38..8b2f07c9c 100644 --- a/docs-master/Config.md +++ b/docs-master/Config.md @@ -72,7 +72,7 @@ gui: # If true, do not show a warning when amending a commit. skipAmendWarning: false - # If true, do not show a warning when discarding changes in the staging view. + # If true, do not show a warning when discarding changes from a focused diff. skipDiscardChangeWarning: false # If true, do not show warning when applying/popping the stash @@ -948,7 +948,7 @@ It is used, for example, when pasting a commit message into the commit message p ## Configuring File Editing -There are two commands for opening files, `o` for "open" and `e` for "edit". `o` acts as if the file was double-clicked in the Finder/Explorer, so it also works for non-text files, whereas `e` opens the file in an editor. `e` can also jump to the right line in the file if you invoke it from the staging panel, for example. +There are two commands for opening files, `o` for "open" and `e` for "edit". `o` acts as if the file was double-clicked in the Finder/Explorer, so it also works for non-text files, whereas `e` opens the file in an editor. `e` can also jump to the right line in the file when you invoke it from a focused diff. To tell lazygit which editor to use for the `e` command, the easiest way to do that is to provide an editPreset config, e.g. @@ -1011,7 +1011,7 @@ When the selected line gets close to the bottom of the window and you hit down-a That's the behavior when `gui.scrollOffBehavior` is set to "margin" (the default). If you set `gui.scrollOffBehavior` to "jump", then upon reaching the last line of a view and hitting down-arrow the view will scroll by half a page so that the selection ends up in the middle of the view. This may feel a little jarring because the cursor jumps around when continuously moving down, but it has the advantage that the view doesn't scroll as often. -This setting applies both to all list views (e.g. commits and branches etc), and to the staging view. +This setting applies both to all list views (e.g. commits and branches etc), and to focused diffs. ## Filtering diff --git a/docs-master/dev/Codebase_Guide.md b/docs-master/dev/Codebase_Guide.md index 1692be33e..5ecff6e9b 100644 --- a/docs-master/dev/Codebase_Guide.md +++ b/docs-master/dev/Codebase_Guide.md @@ -31,7 +31,6 @@ * `pkg/gui/keybindings`: Contains code for mapping between keybindings and their labels * `pkg/gui/mergeconflicts`: Contains code relating to the handling of merge conflicts * `pkg/gui/modes`: Contains code relating to the state of different modes e.g. cherry picking mode, rebase mode. -* `pkg/gui/patch_exploring`: Contains code relating to the state of patch-oriented views like the staging view. * `pkg/gui/popup`: Contains code that lets you easily raise popups * `pkg/gui/presentation`: Contains presentation code i.e. code concerned with rendering content inside views * `pkg/gui/services/custom_commands`: Contains code related to user-defined custom commands. diff --git a/pkg/config/user_config.go b/pkg/config/user_config.go index 37bbc724f..20b6b39f7 100644 --- a/pkg/config/user_config.go +++ b/pkg/config/user_config.go @@ -87,7 +87,7 @@ type GuiConfig struct { MouseEvents bool `yaml:"mouseEvents"` // If true, do not show a warning when amending a commit. SkipAmendWarning bool `yaml:"skipAmendWarning"` - // If true, do not show a warning when discarding changes in the staging view. + // If true, do not show a warning when discarding changes from a focused diff. SkipDiscardChangeWarning bool `yaml:"skipDiscardChangeWarning"` // If true, do not show warning when applying/popping the stash SkipStashWarning bool `yaml:"skipStashWarning"` diff --git a/schema-master/config.json b/schema-master/config.json index b4e7adf24..b9fe29991 100644 --- a/schema-master/config.json +++ b/schema-master/config.json @@ -580,7 +580,7 @@ }, "skipDiscardChangeWarning": { "type": "boolean", - "description": "If true, do not show a warning when discarding changes in the staging view.", + "description": "If true, do not show a warning when discarding changes from a focused diff.", "default": false }, "skipStashWarning": {