Skip to content

Add command to show the previous version of the hunk #14291

@simonecarriero

Description

@simonecarriero

I propose adding a new command show-diff-change to show the previous version of the git hunk under the cursor. This would allow for a quick, inline preview of what has been changed at a specific point in the file.

I believe this feature fits as part of the Helix core rather than being a plugin considering that:

  • the vision for git-related features, as expressed in this comment on #2261 , is that read-only operations are fine for core
  • it's intrinsically coupled with the gutter implementation and the :reset-diff-change command, as the hunks should be exactly the same for consistency

I have a draft implementation in this PR, of course open to any feedback.

show-diff-change.mov

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions