Skip to content

CommitView: '}' mapping goes to first hunk if not in one already#1987

Open
washtubs wants to merge 1 commit into
NeogitOrg:masterfrom
washtubs:go-to-first-hunk
Open

CommitView: '}' mapping goes to first hunk if not in one already#1987
washtubs wants to merge 1 commit into
NeogitOrg:masterfrom
washtubs:go-to-first-hunk

Conversation

@washtubs

Copy link
Copy Markdown

I was frustrated that in the commit view, the "Goto next" } mapping is inert if your cursor is at the top.

The current behavior is that it checks if you are hovering a hunk or diff component, otherwise it does nothing. Now I made it so it searches down to the first hunk or diff component and places the cursor there.

---@param options FindOptions|nil
function Ui:find_component(f, options)
return Ui._find_component(self.layout, f, options or {})
return Ui._find_component(self.layout.children, f, options or {})

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

find_component seemed to be unused. It was not working because the layout doesn't have ipairs as _find_component expects. layout.children does.

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.

1 participant