Unified: Comment on side B when pressing "c" in common regions
If the user presses "c" on a common region, always put a draft comment on the revision side (side B) instead of using the side of the diff chunk immediately before that region. Change-Id: I6dd9f9c7548ba2aba6509aab5866f274fdf43914
This commit is contained in:
@@ -292,8 +292,17 @@ class UnifiedChunkManager extends ChunkManager {
|
|||||||
res = -res - 1;
|
res = -res - 1;
|
||||||
if (res > 0) {
|
if (res > 0) {
|
||||||
UnifiedDiffChunkInfo info = chunks.get(res - 1);
|
UnifiedDiffChunkInfo info = chunks.get(res - 1);
|
||||||
|
int lineOnInfoSide = info.getStart() + cmLine - info.getCmLine();
|
||||||
|
if (lineOnInfoSide > info.getEnd()
|
||||||
|
&& info.getSide() == DisplaySide.A) {
|
||||||
|
// For the common region after a deletion chunk, return the line and
|
||||||
|
// side info on side B
|
||||||
return new LineSidePair(
|
return new LineSidePair(
|
||||||
info.getStart() + cmLine - info.getCmLine(), info.getSide());
|
getLineMapper().lineOnOther(DisplaySide.A, lineOnInfoSide)
|
||||||
|
.getLine(), DisplaySide.B);
|
||||||
|
} else {
|
||||||
|
return new LineSidePair(lineOnInfoSide, info.getSide());
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// Always return side B
|
// Always return side B
|
||||||
return new LineSidePair(cmLine, DisplaySide.B);
|
return new LineSidePair(cmLine, DisplaySide.B);
|
||||||
|
|||||||
Reference in New Issue
Block a user