[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: Stefan Küng <tortoisesvn_at_gmail.com>
Date: Thu, 25 Feb 2010 19:09:58 +0100

On 25.02.2010 14:56, Dmitry wrote:
> 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
> down.
>
> 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.

Committed in r18738.

Stefan

-- 
        ___
   oo  // \\      "De Chelonian Mobile"
  (_,\/ \_/ \     TortoiseSVN
    \ \_/_\_/>    The coolest Interface to (Sub)Version Control
    /_/   \_\     http://tortoisesvn.net
------------------------------------------------------
http://tortoisesvn.tigris.org/ds/viewMessage.do?dsForumId=757&dsMessageId=2452166
To unsubscribe from this discussion, e-mail: [dev-unsubscribe_at_tortoisesvn.tigris.org].
Received on 2010-02-25 19:10:06 CET

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.