Hi,
In TortoiseMerge:
- Look at a diff of a changed file, for example from double click in the commit dialog.
- Paste a few lines (it doesn't have to be related to the changed lines, in the attached image I pasted a few lines in the beginning of the file). TortoiseMerge correctly renumbers all lines.
- Undo (Ctrl-Z). TortoiseMerge removes the pasted lines but doesn't renumber the following lines. See attached picture with lines 1 5 6 7 etc.
If I understand the code correctly, the line numbering is stored in the undo list so I propose to move the call to UpdateViewLineNumbers() above SaveUndoStep(), as follows.
[[[
Index: BaseView.cpp
===================================================================
--- BaseView.cpp (revision 29481)
+++ BaseView.cpp (working copy)
@@ -6765,9 +6765,9 @@
{
m_pwndBottom->InsertViewEmptyLines(nViewLine + 1, nLinesToPaste - 1);
}
+ UpdateViewLineNumbers();
SaveUndoStep();
- UpdateViewLineNumbers();
CUndo::GetInstance().EndGrouping();
ptCaretViewPos = SetupPoint(lines[nLinesToPaste - 1LL].GetLength(), nInsertLine);
]]]
Another solution would be to add another SaveUndoStep() after UpdateViewLineNumbers().
Is this analysis correct or do I miss something? Which version is preferred?
/Daniel