| 813 | }; |
| 814 | |
| 815 | static CEPoint Advance(const CDiffTextBuffer& buf, const CEPoint& pt, int distance) |
| 816 | { |
| 817 | assert(distance >= 0); |
| 818 | CEPoint ptMoved = pt; |
| 819 | while (distance > 0) |
| 820 | { |
| 821 | if (buf.GetLineFlags(ptMoved.y) & LF_GHOST) |
| 822 | break; |
| 823 | else if (ptMoved.x + distance > buf.GetLineLength(ptMoved.y)) |
| 824 | { |
| 825 | distance -= buf.GetFullLineLength(ptMoved.y) - ptMoved.x; |
| 826 | ptMoved.x = 0; |
| 827 | ++ptMoved.y; |
| 828 | const int nLineCount = buf.GetLineCount(); |
| 829 | if (ptMoved.y > nLineCount) |
| 830 | { |
| 831 | ptMoved.x = buf.GetLineLength(nLineCount - 1); |
| 832 | ptMoved.y = nLineCount - 1; |
| 833 | break; |
| 834 | } |
| 835 | } |
| 836 | else |
| 837 | { |
| 838 | ptMoved.x += distance; |
| 839 | distance = 0; |
| 840 | } |
| 841 | } |
| 842 | return ptMoved; |
| 843 | } |
| 844 | |
| 845 | std::tuple<CEPoint, CEPoint, CEPoint, CEPoint> CMergeDoc::GetCharacterRange(int srcPane, int dstPane, int activePane, int nDiff, |
| 846 | const CEPoint& ptStart, const CEPoint& ptEnd) |
no test coverage detected