mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-11 19:20:12 +02:00
IDE: Messages window: fixed autoscroll to new message
git-svn-id: branches/fixes_1_4@47430 -
This commit is contained in:
parent
bc88963e0c
commit
4a59058c9d
@ -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