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

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

Open
connor4312 opened this issue Jun 28, 2022 · 20 comments
Open

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

connor4312 opened this issue Jun 28, 2022 · 20 comments
Assignees
Labels
diff-editor Diff editor issues feature-request Request for new features or functionality
Milestone

Comments

@connor4312
Copy link
Member

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.

@hediet
Copy link
Member

hediet commented Jun 29, 2022

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.

@hediet hediet added feature-request Request for new features or functionality diff-editor Diff editor issues labels Jun 29, 2022
@hediet hediet added this to the On Deck milestone Jun 29, 2022
@Mingpan
Copy link
Contributor

Mingpan commented Jul 2, 2022

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.

@connor4312
Copy link
Member Author

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.

@gulshan
Copy link

gulshan commented Jul 20, 2022

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

@nbransby
Copy link

nbransby commented Sep 1, 2022

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

@shef-er
Copy link

shef-er commented Oct 6, 2022

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

@alexolog
Copy link

alexolog commented Oct 7, 2022

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

@tonoslav
Copy link

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

@cdenneen
Copy link

@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

@wh0else
Copy link

wh0else commented Jan 23, 2023

+1

@cheezit46
Copy link

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.

@RufusVS
Copy link

RufusVS commented Apr 27, 2023

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.

@shef-er
Copy link

shef-er commented Feb 5, 2024

@hediet Any progress on this?

@holdingsllc
Copy link

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

@kmhatre14
Copy link

+1

@nemchik
Copy link

nemchik commented Jul 16, 2024

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.

@kmhatre14
Copy link

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

@nemchik
Copy link

nemchik commented Jul 16, 2024

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.

@nbros
Copy link

nbros commented Sep 18, 2024

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...")

@wwdok
Copy link

wwdok commented Sep 26, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
diff-editor Diff editor issues feature-request Request for new features or functionality
Projects
None yet
Development

No branches or pull requests