mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-11-21 18:09:24 +01:00
IDE: Messages window: fixed autoscroll to new message
git-svn-id: trunk@47379 -
This commit is contained in:
parent
1a2e7ed639
commit
9a43c7ee8f
@ -1052,10 +1052,17 @@ end;
|
||||
procedure TMessagesCtrl.FetchNewMessages;
|
||||
var
|
||||
i: Integer;
|
||||
LastLineWasVisible: Boolean;
|
||||
begin
|
||||
if csDestroying in ComponentState then exit;
|
||||
BeginUpdate;
|
||||
try
|
||||
for i:=0 to ViewCount-1 do begin
|
||||
LastLineWasVisible:=IsLastLineVisible(Views[i]);
|
||||
//debugln(['TMessagesCtrl.FetchNewMessages ScrollTop=',ScrollTop,' ScrollTopMax=',ScrollTopMax,' Last=',View.GetShownLineCount(false,true),' LineTop=',GetLineTop(View,View.GetShownLineCount(false,true),true),' IsLastLineVisible=',LastLineWasVisible]);
|
||||
if LastLineWasVisible and (not Views[i].Running) then
|
||||
AutoScrollToNewMessage:=true; // this view stopped running -> let other views take over the focus
|
||||
end;
|
||||
for i:=0 to ViewCount-1 do
|
||||
FetchNewMessages(Views[i]);
|
||||
finally
|
||||
@ -1073,12 +1080,9 @@ begin
|
||||
if IndexOfView(View)<0 then exit;
|
||||
|
||||
LastLineWasVisible:=IsLastLineVisible(View);
|
||||
//debugln(['TMessagesCtrl.FetchNewMessages START ScrollTop=',ScrollTop,' ScrollTopMax=',ScrollTopMax,' Last=',View.GetShownLineCount(false,true),' LineTop=',GetLineTop(View,View.GetShownLineCount(false,true),true),' IsLastLineVisible=',IsLastLineVisible(View)]);
|
||||
|
||||
OldLineCount:=View.Lines.Count;
|
||||
if (not View.Running) and LastLineWasVisible then
|
||||
AutoScrollToNewMessage:=true; // this view stoped running -> let other views take over the focus
|
||||
if not View.ApplyPending then exit;
|
||||
if not View.ApplyPending then
|
||||
exit; // no new lines
|
||||
CreateSourceMarks(View,OldLineCount);
|
||||
UpdateScrollBar(true);
|
||||
Invalidate;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user