Add scroll_to_first_hunk config option#5
Merged
clabby merged 1 commit intoclabby:mainfrom Jan 13, 2026
Merged
Conversation
4bbd007 to
8fae8da
Compare
yannvanhalewyn
commented
Jan 9, 2026
| end | ||
| if opts.scroll_to_first_hunk ~= nil then | ||
| M.config.scroll_to_first_hunk = opts.scroll_to_first_hunk | ||
| end |
Contributor
Author
There was a problem hiding this comment.
I was also confused at first as to why my config option was not being picked up. Maybe using a deep merge would be a good change to prevent future mistakes, I'm happy to make the change if you want
clabby
approved these changes
Jan 13, 2026
Owner
clabby
left a comment
There was a problem hiding this comment.
Thanks! We need to also add this opt to the doc txt, but I'll follow up with that.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds the option
scroll_to_first_hunkwhich scrolls to the first hunk when opening a file. Diffview collapses unchanged code meaning you always see the diff first. I like seeing the whole file, but I don't care about the stuff that did not change :).I've made it configurable with a default of false to not change any existing behavior. I do think this is always desirable and we can consider making this regular behavior without config option, what are your thoughts?