TortoiseMerge, paste multiline + undo doesn't restore line numbers correctly
Daniel Sahlberg via TortoiseSVN-dev <[email protected]> Sat, 26 Nov 2022 09:39:39 -0800 (PST)
| Newsgroups | gmane.comp.version-control.subversion.tortoisesvn.devel |
|---|---|
| Message-ID | <[email protected]> |
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
--
You received this message because you are subscribed to the Google Groups "TortoiseSVN-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/tortoisesvn-dev/dc65329b-f756-4eaf-8fec-0ebda5ea2118n%40googlegroups.com.
TortoiseMerge wrong line numbers.png
(image/png, 2 KB) - not displayed