Skip to content

Add the ability to scroll the diff viewport with J and K while the file view is focused #220

Closed

Description

@steve-mackinnon

Hi there,

I'm really enjoying revdiff, thanks for making it!

I often find myself wanting to scroll the diff viewport while the file view has focus. This behavior exists in lazygit today, and it's quite nice to be able to change which file is selected, then scroll its diff viewport without needing to explicitly tab over to the file view. So the proposal here is to bind shift + J and shift + K to scroll down and up on the diff viewport while the file view has focus.

I've made this change locally and would be happy to open a PR if you're interested in contributions.

Activity

  1. umputun commented on Jun 5, 2026

    @umputun
    Owner

    yep, interested. J/K are free and lazygit parity makes sense, go ahead with the PR.

    one thing to sort out in the PR: the keymap is global (key resolves to one action, panes just interpret it differently in handleTreeAction / handleDiffAction), so whatever J/K map to is also reachable when the diff pane is focused. Decide what they do there too, scrolling the diff is the obvious consistent choice. There's already a pure-scroll primitive you can reuse, scrollDiffViewportBy in app/ui/mouse.go.

    also pls add it as default bindings in app/keymap (with help/docs entries) so it's configurable, and add tests for the tree-focused path.

  2. steve-mackinnon commented on Jun 5, 2026

    @steve-mackinnon
    ContributorAuthor

    Sounds great, thanks for the detail. I'll try to have this up later today.

  3. steve-mackinnon commented on Jun 6, 2026

    @steve-mackinnon
    ContributorAuthor

    PR opened here: #224

  4. umputun commented on Jun 7, 2026

    @umputun
    Owner

    merged in #224. J/K now scroll the diff viewport while the tree has focus, matching lazygit. Thx for the clean PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions