• R/O
  • SSH
  • HTTPS

tortoisesvn: Commit


Commit MetaInfo

Revisão29090 (tree)
Hora2021-03-06 18:22:32
Autorstefankueng

Mensagem de Log

keep the current line in the view when resizing with line-wrap on in TortoiseMerge

Mudança Sumário

Diff

--- trunk/src/Changelog.txt (revision 29089)
+++ trunk/src/Changelog.txt (revision 29090)
@@ -2,6 +2,9 @@
22 - BUG: when starting a log dialog from an existing
33 log dialog, the project properties were
44 not read anymore. (Stefan)
5+- BUG: When line-wrapping is on in TMerge and
6+ the window is resized, the current line
7+ was not kept in the view. (Stefan)
58
69 Version 1.14.1
710 - BUG: TortoiseMerge crashed if configured to
--- trunk/src/TortoiseMerge/BaseView.cpp (revision 29089)
+++ trunk/src/TortoiseMerge/BaseView.cpp (revision 29090)
@@ -2294,10 +2294,18 @@
22942294 m_nScreenChars = -1;
22952295 if (m_nLastScreenChars != GetScreenChars())
22962296 {
2297+ auto oldCaretLine = m_ptCaretViewPos.y;
22972298 BuildAllScreen2ViewVector();
22982299 m_nLastScreenChars = m_nScreenChars;
22992300 if (m_pMainFrame && m_pMainFrame->m_bWrapLines)
23002301 {
2302+ auto newCaretLine = FindScreenLineForViewLine(oldCaretLine);
2303+ int nNewTopLine = newCaretLine - GetScreenLines() / 2;
2304+ if (nNewTopLine < 0)
2305+ nNewTopLine = 0;
2306+ if (nNewTopLine >= (int)m_Screen2View.size())
2307+ nNewTopLine = (int)m_Screen2View.size() - 1;
2308+ ScrollToLine(nNewTopLine);
23012309 // if we're in wrap mode, the line wrapping most likely changed
23022310 // and that means we have to redraw the whole window, not just the
23032311 // scrolled part.
Show on old repository browser