We copy diff lines line per line, in
CMergeDoc::ListCopy() :
778: // copy the selected text over
779: for (int i=cd_dbegin; i <= limit; i++)
780: {
781: // text exists on left side, so just replace
782: strLine = _T("");
783: sbuf.GetFullLine(i, strLine);
784: dbuf.ReplaceFullLine(curView, i, strLine,
CE_ACTION_MERGE);
785: dbuf.FlushUndoGroup(curView);
786: dbuf.BeginUndoGroup(TRUE);
787: }
788: dbuf.FlushUndoGroup(curView);
Why do we need to flush/begin undogroup for every line?
After all we end up to
CMergeDoc::CDiffTextBuffer::ReplaceLine():
1723: if (GetLineLength(nLine)>0)
1724: DeleteText(pSource, nLine, 0, nLine,
GetLineLength(nLine), nAction);
1725: int endl,endc;
1726: if (! strText.IsEmpty())
1727: InsertText(pSource, nLine, 0, strText,
endl,endc, nAction);
1728: }
Seems a lot of work per line for me? Several line
length checks etc. Couldn't we copy multiple lines at a
time?
Logged In: YES
user_id=1195173
I am not familiar with this code (at least not now, if I
ever was).
Logged In: YES
user_id=631874
Lowering priority.