1

I keep running into the following problem and it really exacerbates my OCD. Look at the following screenshot.

enter image description here

I added that whole testAction function to the end of a class but instead of highlighting the whole function as having been added (with that green border), it skips one of the curly braces of the if statement and instead highlights the last curly brace of the class definition. Is there a way to tell Netbeans that the function definition and body (and only the function definition and body) should be highlighted instead?

1 Answer 1

1

This is because of a git hunk definition: how git determines what has changed.
See "Unexpected result in git-diff" as an example.

Here, Git determine the } has not changed compared to the previous code, and detect two hunks (block of changes).

Sign up to request clarification or add additional context in comments.

2 Comments

Is there a way to manually force git to change its determination?
@KodosJohnson I don't think so. GIT_DIFF_OPTS might have an influence (stackoverflow.com/a/33891676/6309)

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.