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

Hunk selection in NGitStageNextHunk #1

Open
padawin opened this issue Sep 17, 2024 · 0 comments
Open

Hunk selection in NGitStageNextHunk #1

padawin opened this issue Sep 17, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@padawin
Copy link
Owner

padawin commented Sep 17, 2024

A hunk contains some context lines, for example:

@@ 1,7 1,7 @@
 some context 1
 some context 2
 some context 3
-a removed line 4
+an added line 4
 some context 5
 some context 6
 some context 7

If the cursor is one line 5, 6 or 7, and there is another change later in the file, running :NGitStageNextHunk would be expected to select the next hunk (because the cursor is after the changed lines, the 4), but because the hunk includes context lines, the lines 5, 6 and 7 are part of this first hunk.

It would be good to ignore these lines when detecting the next hunk.

The problem is that the number of context lines (default 3) is configurable (with git config diff.context #) and this value should be taken in account when identifying hunk.

@padawin padawin added the bug Something isn't working label Sep 17, 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

1 participant