Skip to content

Allow merging from right to left with diff arrows view #153620

Open

Description

Testing #25887

The arrows work for merging from the left hand to the right-hand file, that's great 👍

However, there's no way to do the opposite. I was thinking I could alt or shift-click on the arrow (or at least have a context menu) to go the other direction, but I cannot.

Activity

  1. hediet commented on Jun 29, 2022

    @hediet
    Member

    FYI Mingpan. Maybe we can use the EditorGutter in the merge editor to get rid of the glyphs. Then we can show arrows next to each other for both ways.

  2. added
    feature-request
    diff-editor
    on Jun 29, 2022
  3. Mingpan commented on Jul 2, 2022

    @Mingpan
    Contributor

    Thanks for the feedback!

    I think right => left arrows are helpful when the left-hand-side editor is editable (e.g. in a file-to-file compare view). But they don't make sense for same-file diff views ("source control diff views"). This should be considered when implementing this.

    Put this in a right-click context menu sounds doable and doesn't affect the editor experience too much (e.g. doesn't consume more horizontal space), though a nit-picking point is it is not symmetric and doesn't treat left / right arrows equal.

    Maybe we can use the EditorGutter in the merge editor to get rid of the glyphs. Then we can show arrows next to each other for both ways.

    Thanks for the pointer, I'll take a look at the EditorGutter and see if / how the arrows can make use of it.

  4. connor4312 commented on Jul 2, 2022

    @connor4312
    MemberAuthor

    Yea, the use case I was using for testing was "compare active file with...". I think if the LHS is readonly, then having unidirectional arrows makes sense.

  5. gulshan commented on Jul 20, 2022

    @gulshan

    I think an option to "swap sides" in the comparison page will be good enough for me.

  6. nbransby commented on Sep 1, 2022

    @nbransby

    In IntelliJ the arrows are added to whichever side is editable which can mean they could both appear at the sametime, also atm the arrows from the left to the right hand side appear even if the right hand file is not editable and don't do anything upon click

  7. shef-er commented on Oct 6, 2022

    @shef-er

    Also want this feature. Wonder this feature still has not implemented

  8. alexolog commented on Oct 7, 2022

    @alexolog

    Another vote for bidirectional copying. There is more to diff than source control.

  9. tonoslav commented on Oct 25, 2022

    @tonoslav

    I think adding just some shortcut to switch direction would be awesome, for example if you hold CTRL arrow would switch to left and do what is should

  10. cdenneen commented on Nov 21, 2022

    @cdenneen

    Mingpan would adding the opposite direction be possible?

    Also noticed that if you have a complete empty space the copy arrow works... if not it doesn't provide an option to copy what is on left to right... so for in the screenshot maybe we want to copy the format from left to right? It doesn't provide an arrow to do that. Those are only provided where complete lines are missing on the right side.

    Screen Shot 2022-11-21 at 9 11 26 AM

  11. wh0else commented on Jan 23, 2023

    @wh0else

    +1

  12. cheezit46 commented on Mar 22, 2023

    @cheezit46

    Definitely would like a left arrow.

    I know we'd basically be making the Meld tool in vs-code, and I'm fine with that.

  13. RufusVS commented on Apr 27, 2023

    @RufusVS

    So I have to do the compare merge in BeyondCompare external to VSCode be able to copy-left AND copy-right? Maybe I'll look into the Meld tool until this gets "fixed". Although swapping sides may be useful, but there are many times I am moving changes in both directions. I love my BeyondCompare, but we don't need THAT much functionality.

  14. shef-er commented on Feb 5, 2024

    @shef-er

    Henning Dieterichs (@hediet) Any progress on this?

  15. holdingsllc commented on Feb 22, 2024

    @holdingsllc

    I'm amazed that this essential feature still doesn't exist. What's going on?

  16. kmhatre14 commented on Jul 15, 2024

    @kmhatre14

    +1

  17. nemchik commented on Jul 16, 2024

    @nemchik

    It seems like the ability to swap what is on the left and right now exists, so it's possible to achieve getting changes from A to B or B to A.

  18. kmhatre14 commented on Jul 16, 2024

    @kmhatre14

    How do you swap?
    I don't see any option when I select files to compare

  19. nemchik commented on Jul 16, 2024

    @nemchik

    Two new unsaved files
    image
    Swap button
    image

    So with that you can effectively "copy from right to left" by swapping (and then if you need you can swap back)

    Note; I don't think you can do this with the diff editor when using it to compare changes to a file in version control. You're not comparing two files, you're comparing the current state to a previous state. The previous state (last commit) is locked in, so you can't swap in order to copy changes from current state to previous state.

  20. nbros commented on Sep 18, 2024

    @nbros

    Repeatedly swapping left and right sides to pick the right one works but I find it disorienting, I'd still much rather have two arrows pointing each side to "Copy left to right" / "Copy right to left" in the case when both sides are editable (for example when using "File: Compare Active File With...")

  21. wwdok commented on Sep 26, 2024

    @wwdok

    It can add a column of left arrow as shown in the following red box:
    image

  22. erdult commented on Feb 13, 2025

    @erdult

    this is a required addition, also shortcut keys to move between

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

Metadata

Metadata

Labels

diff-editorfeature-request

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions