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

Reset all changes overlapped by selections in :reset-diff-change #10178

Merged
merged 1 commit into from May 20, 2024

Conversation

the-mikedavis
Copy link
Member

@the-mikedavis the-mikedavis commented Apr 6, 2024

This is useful for resetting multiple changes at once. For example you might use maf or even % to select a larger region and reset all changes within.

The original behavior of resetting the change on the current line is retained when the primary selection is 1-width since we look for chunks in the line range of the primary each selection.

@the-mikedavis the-mikedavis added C-enhancement Category: Improvements S-waiting-on-review Status: Awaiting review from a maintainer. A-vcs Area: Version control system interaction A-command Area: Commands labels Apr 6, 2024
@the-mikedavis the-mikedavis added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from a maintainer. labels Apr 6, 2024
This is useful for resetting multiple changes at once. For example you
might use 'maf' or even '%' to select a larger region and reset all
changes within.

The original behavior of resetting the change on the current line is
retained when the primary selection is 1-width since we look for chunks
in the line range of each selection.
@the-mikedavis the-mikedavis changed the title Reset all changes overlapped by primary sel in :reset-diff-change Reset all changes overlapped by selections in :reset-diff-change Apr 9, 2024
@the-mikedavis the-mikedavis added S-waiting-on-review Status: Awaiting review from a maintainer. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Apr 9, 2024
Copy link
Member

@pascalkuthe pascalkuthe left a comment

Choose a reason for hiding this comment

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

lgtm this will be a great usability improvement!

@pascalkuthe pascalkuthe added this to the next milestone Apr 10, 2024
mandx added a commit to mandx/helix that referenced this pull request Apr 30, 2024
…-selection-diff`

These are similar to the `reset-diff-change` command, except that rather
wthan apply the diff base, the unsaved buffer changes (in `diff` syntax)
are shown in a popup (with `show-selection-diff-popup`) or yanked to a
register (using `yank-selection-diff`).

This uses the new `hunks_intersecting_line_ranges` method from helix-editor#10178,
so probably that PR should be merged first before considering merging
this one.
@archseer archseer merged commit ff6aca1 into master May 20, 2024
6 checks passed
@archseer archseer deleted the reset-diff-change-in-range branch May 20, 2024 12:40
mandx added a commit to mandx/helix that referenced this pull request May 20, 2024
…-selection-diff`

These are similar to the `reset-diff-change` command, except that rather
wthan apply the diff base, the unsaved buffer changes (in `diff` syntax)
are shown in a popup (with `show-selection-diff-popup`) or yanked to a
register (using `yank-selection-diff`).

This uses the new `hunks_intersecting_line_ranges` method from helix-editor#10178,
so probably that PR should be merged first before considering merging
this one.
mandx added a commit to mandx/helix that referenced this pull request May 20, 2024
…-selection-diff`

These are similar to the `reset-diff-change` command, except that rather
wthan apply the diff base, the unsaved buffer changes (in `diff` syntax)
are shown in a popup (with `show-selection-diff-popup`) or yanked to a
register (using `yank-selection-diff`).

This uses the new `hunks_intersecting_line_ranges` method from helix-editor#10178,
so probably that PR should be merged first before considering merging
this one.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-command Area: Commands A-vcs Area: Version control system interaction C-enhancement Category: Improvements S-waiting-on-review Status: Awaiting review from a maintainer.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants