Skip to content

Add scroll_to_first_hunk config option#5

Merged
clabby merged 1 commit intoclabby:mainfrom
yannvanhalewyn:add-scroll-to-first-hunk
Jan 13, 2026
Merged

Add scroll_to_first_hunk config option#5
clabby merged 1 commit intoclabby:mainfrom
yannvanhalewyn:add-scroll-to-first-hunk

Conversation

@yannvanhalewyn
Copy link
Contributor

This adds the option scroll_to_first_hunk which 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?

@yannvanhalewyn yannvanhalewyn force-pushed the add-scroll-to-first-hunk branch from 4bbd007 to 8fae8da Compare January 8, 2026 06:01
end
if opts.scroll_to_first_hunk ~= nil then
M.config.scroll_to_first_hunk = opts.scroll_to_first_hunk
end
Copy link
Contributor Author

@yannvanhalewyn yannvanhalewyn Jan 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Owner

@clabby clabby left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! We need to also add this opt to the doc txt, but I'll follow up with that.

@clabby clabby merged commit a2beee7 into clabby:main Jan 13, 2026
3 checks passed
@yannvanhalewyn yannvanhalewyn deleted the add-scroll-to-first-hunk branch January 14, 2026 10:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants