1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-08-06 22:33:07 +02:00

Don't use hunk mode for added or deleted files

When entering staging (or patch building) for an added or deleted file, it
doesn't make sense to use hunk mode, because pressing space would stage/unstage
the entire file, and if the user wanted to do that, they would have pressed
space in the Files panel. So always use line mode for added/deleted files by
default, even if the useHunkModeInStagingView user config is on.
This commit is contained in:
Stefan Haller
2025-07-20 16:07:24 +02:00
parent fc3b725424
commit c5acad777d
3 changed files with 76 additions and 1 deletions

View File

@ -67,7 +67,7 @@ func NewState(diff string, selectedLineIdx int, view *gocui.View, oldState *Stat
}
selectMode := LINE
if useHunkModeByDefault {
if useHunkModeByDefault && !patch.IsSingleHunkForWholeFile() {
selectMode = HUNK
}