You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
If I make the context size of a diff excessively large then jumping between hunks no longer works.
To Reproduce
Have a fairly large file with spaced out diffs.
Enter the staging view
Start increasing the context size as you try navigating between hunks with the arrow keys
Eventually with a large enough context the navigation ceases to work and it only stays on the first hunk. Staging all lines in a hunk will still correctly jump to the next hunk
Expected behavior
Either the hunk navigation works with a large context or there's some other indicator that your context is too large. Spent a good while thinking the staging view was broken because I didn't realize I had messed with the default context.
I see how this can be confusing, but I'm afraid this is working as intended. When jumping between hunks, it considers hunks to be sections of the diff separated by @@ lines. There can be several blocks of changes within a single hunk, and by increasing the context you cause more blocks of changes to go into a single hunk, to the point where eventually the entire diff consists of only a single hunk. There's nothing to jump between any more in that case.
Now, it might seem reasonable to change the behavior of left/right arrow to jump between blocks of changes rather than hunks; that would be a feature request and not a bug report though (splitting hairs here 😄). The question, then, is how this interacts with hunk selection mode (you enter that by pressing a).
Describe the bug
If I make the context size of a diff excessively large then jumping between hunks no longer works.
To Reproduce
Expected behavior
Either the hunk navigation works with a large context or there's some other indicator that your context is too large. Spent a good while thinking the staging view was broken because I didn't realize I had messed with the default context.
Version info:
The text was updated successfully, but these errors were encountered: