[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Bug: Views scroll on pressing "Reload"

From: Dmitry <wipedout_at_yandex.ru>
Date: Thu, 25 Feb 2010 16:56:52 +0300

Here's an update. This behavior is only reproduced for deleting or inserting lines, not for changing M-to-M. Just delete or insert one line and scroll down so that the line in question is obscured by the view top. If a line was inserted the view scrolls up on each reload. If a line was deleted the view scrolls

Here's why.

When a line is inserted CMainFrame::LoadViews() invokes

    nOldLineNumber = m_pwndLeftView->m_pViewData->GetLineNumber(m_pwndLeftView->m_nTopLine);

the current top line M corresponds to line M-1 in the original file, this M-1 value is later used as the scroll target.

The problem occurs for a similar reason when a line is deleted. The assignment in the biginng maps the top line M to line M in the original file, then this value is passed into

    n = m_pwndRightView->m_pViewData->FindLineNumber(n);

and is mapped onto line M+1 in the resulting file.

The following patch maybe fixes the problem - I compiled TMerge and tested and it looks working.

Best wishes.


To unsubscribe from this discussion, e-mail: [dev-unsubscribe_at_tortoisesvn.tigris.org].

Received on 2010-02-25 14:57:03 CET

This is an archived mail posted to the TortoiseSVN Dev mailing list.