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

Copy/replace/add left <-> right in compare views #25887

Closed
Dominik-K opened this issue May 4, 2017 · 207 comments
Closed

Copy/replace/add left <-> right in compare views #25887

Dominik-K opened this issue May 4, 2017 · 207 comments
Assignees
Labels
diff-editor Diff editor issues feature-request Request for new features or functionality verification-needed Verification of issue is requested verified Verification succeeded
Milestone

Comments

@Dominik-K
Copy link

In the compare views, it would be nice to have

  • "Copy to left/right"
  • "Replace left (with right)/right (with left)"
  • "Add above/down left/right"

in all views, i.e. the side-by-side and the unified view (there with other text than "left/right").

Now, I need to select the text and copy-paste it. In the unified view, I even can't select the text from the compared file ("left" file in side-by-side view).

A nice UI would be the one as in Meld:
image

Related: #24390 (but only wanted for staging VCS diffs)
Blocked by: #4180 ?

@kieferrm kieferrm added feature-request Request for new features or functionality diff-editor Diff editor issues labels May 4, 2017
@alexdima alexdima added this to the Backlog milestone May 21, 2017
@alexdima alexdima removed their assignment May 21, 2017
@gulshan
Copy link

gulshan commented Aug 11, 2017

Similar proposal by me following git merge inline actions- #30519

@elgrafico
Copy link

I miss that feature as well. Good old NetBeans has a a similar intuitive approach:

diff_netbeans-8 2

Only the right side can be edited though, but there's a "swap" button right above the diff to mitigate that ;-)

@otienoanyango

This comment was marked as off-topic.

@rkotenko

This comment was marked as off-topic.

@bradkemper
Copy link

I was very surprised that this did not already exist in VS Code. BBEdit isn't perfect, but it does have that.

@seanchann
Copy link

+1

@MaerF0x0
Copy link

Super bonus points for allowing mapping to keys so i can create a vim-diff copy
(eg: do takes the other (usually left) side's changes)

@sigmarising
Copy link

This is a really good feature which I am looking forward to.

In most coding time, I need to diff and merge only two files. I just want to diff and merge and there is no need for me to use git diff for only two files.

In present, I use the tool "diff & merge" from jet brains IDE. This is a really good sample plate to reference.

I strongly suggest this feature provided in the future version of VSCode.

The diff & merge feature in JetBrains IDE

@vbuyonje
Copy link

Many of us awaiting why not write it

@gongiskhan
Copy link

+1

@C0smin
Copy link

C0smin commented Aug 1, 2018

We need this so bad

@ufchta
Copy link

ufchta commented Aug 23, 2018

This is probably my biggest problem with VS Code so far. I was very surprised that this did not already exist.
Any chance that this will be added?

@andreasanta
Copy link

+1

3 similar comments
@gztomas
Copy link

gztomas commented Sep 17, 2018

+1

@maxthemillion
Copy link

+1

@matt-wormley
Copy link

+1

@gulshan
Copy link

gulshan commented Sep 22, 2018

As my proposal #30519 was closed as a duplicate of this one, pasting the text here-

Inline actions in diff view for copy, replace, previous and next

This proposal requests inline actions in diff view, like the inline merge actions are provided for git merge markers within the editor-
inline_diff

The code actions can be Copy to left/right/other side, Replace left/right/other side, Previous and Next (for going to previous/next diff). And as copying original is prohibited in inline diff view, there can be a Copy original action as well.

This proposal can be regarded as an implementation detail of the proposal #25887 .

@miguelsolorio
Copy link
Contributor

Looks great, the only minor issue (and not sure if it's even a real issue) is that breakpoints appear in the gutter so this might conflict with it if someone is trying to add/remove a breakpoint (which I think is minimal)

@schnort
Copy link

schnort commented Jun 9, 2022 via email

@miguelsolorio
Copy link
Contributor

miguelsolorio commented Jun 9, 2022

@schnort this is why I said:

only minor issue (and not sure if it's even a real issue)

This is the only drawback and other extensions use the gutter besides breakpoints as well, so it's something to keep in mind but not blocking.

@bpasero
Copy link
Member

bpasero commented Jun 11, 2022

Are breakpoints important or even relevant in the diff window?

Yes, the right hand side of a diff editor should behave identical to a normal editor, i.e. you can edit, goto definition within, use editor widgets within, add breakpoints, etc.

@Sebi2020
Copy link

Sebi2020 commented Jun 11, 2022

Yes, the right hand side of a diff editor should behave identical to a normal editor

@bpasero why?! It makes no sense to set a breakpoint in a compare view. While editing and goto definitions within is useful and practical, breakpoints aren't.

@schnort
Copy link

schnort commented Jun 11, 2022 via email

@gulshan
Copy link

gulshan commented Jun 11, 2022

I would request to look into my suggestion again. It is based on inline actions, thus leaving the gutter- #25887 (comment)

@bpasero
Copy link
Member

bpasero commented Jun 12, 2022

@Sebi2020

It makes no sense to set a breakpoint in a compare view.

Treating the right hand side of a compare editor like a normal editor was a design decision from the beginning with the main intent to allow for edits. But I see no reason why we would artificially reduce functionality from the right hand side without reasons.

When I review my changes I like the fact that I can test a change in the debugger right from the compare view by adding a breakpoint. See this example where I want to test a change to a test I did:

Recording 2022-06-12 at 06 36 44

Btw in the design from the OP I see no problem with still having breakpoints in the editor gutter:

image

@Nahor
Copy link

Nahor commented Jun 12, 2022

@bpasero, actually in that last picture, the cross is not a breakpoint, it's to remove the change. So the gutter is probably not usable to add breakpoints or other non-diff functionality (that said, I never used Netbeans so I could be wrong)

But I see no reason why we would artificially reduce functionality from the right hand side without reasons.

... uh, to avoid an overloaded UI? Isn't that what Misolori essentially said?

I can test a change in the debugger right from the compare view by adding a breakpoint.

I guess to each is own. I appreciate the option to edit the code to fix minor issues (e.g. typos) and running the app/test to make sure I didn't introduce a stupid bug. But if I'm at a point where I need a breakpoint, personally I'd rather have a fullscreen window where I can see the whole code instead of being limited to a narrow column (in that regard, I'd love have a quick/easy way to switch to the fullscreen editor from the diff view, with the cursor already moved to the same location as in the diff, I think that would be more useful overall than being able to place/remove breakpoints)

@hediet
Copy link
Member

hediet commented Jun 13, 2022

Implemented in #151826.
If the breakpoint thing is a blocker, we can still revert.

@hediet hediet closed this as completed Jun 13, 2022
@bpasero bpasero modified the milestones: Backlog, June 2022 Jun 14, 2022
@hediet
Copy link
Member

hediet commented Jun 14, 2022

I'm just realizing now that #151826 only partially adresses this.

Please create a new feature request if the feature-set not covered in that PR is important for you.

@AnrDaemon
Copy link

Please refer back to this issue so that interested parties could see and track it. (And avoid re-posting same request over and over again!)

@APerricone
Copy link

I am touched, I saw arrows on compare! after only 5 years

@heartacker
Copy link
Contributor

I am touched, I saw arrows on compare! after only 5 years

you have right arrow after 5 years but left[失望]

@RedWingBB
Copy link

Sweet!
How about taking this valuable change to the compare in VS 2022?

@tdegeus
Copy link

tdegeus commented Jul 20, 2022

As far as I understand I can only merge to the right, not to the left? Is this in the pipeline?

@KamasamaK
Copy link

As far as I understand I can only merge to the right, not to the left? Is this in the pipeline?

See #153620

@tarekahf
Copy link

I'm very happy with this change. Now I can merge to the right and hopefully the left will come soon!

@liftconfig
Copy link

Anyone know if there is a keyboard shortcut for the new update from left to right functionality?

@github-actions github-actions bot locked and limited conversation to collaborators Jul 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
diff-editor Diff editor issues feature-request Request for new features or functionality verification-needed Verification of issue is requested verified Verification succeeded
Projects
None yet
Development

No branches or pull requests