Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to navigate between hunks with large context sizes #3990

Closed
NextMerge opened this issue Oct 13, 2024 · 1 comment
Closed

Unable to navigate between hunks with large context sizes #3990

NextMerge opened this issue Oct 13, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@NextMerge
Copy link

NextMerge commented Oct 13, 2024

Describe the bug
If I make the context size of a diff excessively large then jumping between hunks no longer works.

To Reproduce

  1. Have a fairly large file with spaced out diffs.
  2. Enter the staging view
  3. Start increasing the context size as you try navigating between hunks with the arrow keys
  4. 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.

Version info:

% lazygit --version
commit=611fabde11d24d9acc71ee26077b9a1101f59f27, build date=2024-09-18T10:56:10Z, build source=binaryRelease, version=0.44.1, os=darwin, arch=arm64, git version=2.47.0
% git --version
git version 2.47.0
@NextMerge NextMerge added the bug Something isn't working label Oct 13, 2024
@stefanhaller
Copy link
Collaborator

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).

@NextMerge NextMerge closed this as not planned Won't fix, can't repro, duplicate, stale Oct 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants