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

fix go to bottom binding for reflog #1640

Merged
merged 2 commits into from
Dec 28, 2021

Conversation

fsmiamoto
Copy link
Contributor

I was able to reproduce the issue described at #1584 and adding an extra binding seemed to do the trick.

Let me know if the proper fix should be something else.

@fsmiamoto
Copy link
Contributor Author

The pushTag test is still failing so my fix done at #1469 probably wasn't enough 👀

Copy link
Owner

@jesseduffield jesseduffield left a comment

Choose a reason for hiding this comment

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

one thing

@@ -401,6 +401,7 @@ func (gui *Gui) getListContextKeyBindings() []*Binding {
{ViewName: listContext.GetViewName(), Tag: "navigation", Contexts: []string{string(listContext.GetKey())}, Key: gui.getKey(keybindingConfig.Universal.PrevPage), Modifier: gocui.ModNone, Handler: listContext.handlePrevPage, Description: gui.Tr.LcPrevPage},
{ViewName: listContext.GetViewName(), Tag: "navigation", Contexts: []string{string(listContext.GetKey())}, Key: gui.getKey(keybindingConfig.Universal.NextPage), Modifier: gocui.ModNone, Handler: listContext.handleNextPage, Description: gui.Tr.LcNextPage},
{ViewName: listContext.GetViewName(), Tag: "navigation", Contexts: []string{string(listContext.GetKey())}, Key: gui.getKey(keybindingConfig.Universal.GotoTop), Modifier: gocui.ModNone, Handler: listContext.handleGotoTop, Description: gui.Tr.LcGotoTop},
{ViewName: listContext.GetViewName(), Tag: "navigation", Contexts: []string{string(listContext.GetKey())}, Key: gui.getKey(keybindingConfig.Universal.GotoBottom), Modifier: gocui.ModNone, Handler: listContext.handleGotoBottom, Description: gui.Tr.LcGotoBottom},
Copy link
Owner

Choose a reason for hiding this comment

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

if you look around line 413 we're setting the GotoBottom handler dynamically i.e. every context has a default handler for it but we override it for the commits view. Perhaps we should be only doing that override for the branch commits context given that the view will contain the reflog commits context as well

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm now it makes sense, I've changed it to use the Key field to only apply the custom handler to the Branch Commits context

@jesseduffield jesseduffield merged commit 8a76b5a into jesseduffield:master Dec 28, 2021
@jesseduffield
Copy link
Owner

nice work!

@fsmiamoto fsmiamoto deleted the fix_gotobottom branch December 31, 2021 00:26
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.

None yet

2 participants