Bug 563751 - Options for copying conflicting regions
Summary: Options for copying conflicting regions
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Compare (show other bugs)
Version: 4.16   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Platform-Compare-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-05-30 08:57 EDT by Stephan Herrmann CLA
Modified: 2020-05-30 08:57 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stephan Herrmann CLA 2020-05-30 08:57:02 EDT
When the compare editor shows a conflict between left and right, it would be great to have three modes of copying from one side to the other: before/after/replace.

Currently, the copy is always appended after the conflict region in the target, which is fine, e.g., for two independently added methods.

Most importantly I suggest to add a gesture for replacing the target region with the source region.

For symmetry, also prepending should be supported.

One possibility: when invoking the "copy left-to-right" or "..right-to-left" operation raise a little popup with just those three options "before/replace/after".

Alternatively, the effect of that action could be influenced by setting the selection in the target editor:
- placing the caret at any location in the target editor determines the location of insertion
- selecting an area in the target area causes that area to be overwritten.
Both rules should perhaps apply only when the selection is entirely within the conflict region.

This alternative is more powerful, but less obvious / discoverable.

BTW: placing the caret in either editor can cause the other editor to jump to the top of the file, which can be annoying at times :) I haven't checked if a bug already exists for that problem. For the alternative solution this should probably be addressed at the same time.