diff --git a/Src/DiffWrapper.cpp b/Src/DiffWrapper.cpp index f2a2a8540d4..91e46e2afd1 100644 --- a/Src/DiffWrapper.cpp +++ b/Src/DiffWrapper.cpp @@ -1535,7 +1535,7 @@ std::vector CDiffWrapper::InsertMovedBlocks3Way() { DiffRangeInfo diffInfoT = diffInfo2; for (int pane = 0; pane < 3; ++pane) - diffInfoT.end[pane] = std::clamp(diffInfo.begin[pane] + i - 1, 0, diffInfo.end[pane]); + diffInfoT.end[pane] = std::clamp(diffInfo.begin[pane] + i - 1, -1, diffInfo.end[pane]); result.push_back(diffInfoT); } @@ -1543,7 +1543,7 @@ std::vector CDiffWrapper::InsertMovedBlocks3Way() for (int pane = 0; pane < 3; ++pane) { diffInfoM.begin[pane] = std::clamp(diffInfo.begin[pane] + i, 0, diffInfo.end[pane] + 1); - diffInfoM.end[pane] = std::clamp(diffInfo.begin[pane] + i, 0, diffInfo.end[pane]); + diffInfoM.end[pane] = std::clamp(diffInfo.begin[pane] + i, -1, diffInfo.end[pane]); } result.push_back(diffInfoM);