mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-28 22:20:25 +02:00
IDE, SourceEditor: Fix vertical scrolling of newly opened files, introduced by revision 22549 #ba1566e224 ( Defer switching notebook-tab ... )
git-svn-id: trunk@22554 -
This commit is contained in:
parent
8e593d7601
commit
aa67f8e364
19
ide/main.pp
19
ide/main.pp
@ -7267,6 +7267,19 @@ begin
|
||||
except
|
||||
MessageDlg(lisError, lisFailedToLoadFoldStat, mtError, [mbOK], 0);
|
||||
end;
|
||||
|
||||
// Setting the PageIndex causes painting:
|
||||
// It must be done after setting the highlighter
|
||||
// It must be done before setting the Caret or Leftchar may be wrongly adjusted, becaues the PageControl only resizes on show
|
||||
if NewSrcEditorCreated then begin
|
||||
// avoid flicker, by painting the correct text already
|
||||
NewSrcEdit.EditorComponent.TopLine:=NewTopLine;
|
||||
NewSrcEdit.EditorComponent.LeftChar:=NewLeftChar;
|
||||
NewSrcEdit.EditorComponent.EndUpdate;
|
||||
SourceNotebook.Notebook.PageIndex := AnUnitInfo.EditorIndex;
|
||||
NewSrcEdit.EditorComponent.BeginUpdate;
|
||||
end;
|
||||
|
||||
NewSrcEdit.EditorComponent.CaretXY:=NewCaretXY;
|
||||
NewSrcEdit.EditorComponent.TopLine:=NewTopLine;
|
||||
NewSrcEdit.EditorComponent.LeftChar:=NewLeftChar;
|
||||
@ -7275,12 +7288,6 @@ begin
|
||||
NewSrcEdit.ReadOnly:=AnUnitInfo.ReadOnly;
|
||||
NewSrcEdit.Modified:=false;
|
||||
|
||||
// Setting the PageIndex causes painting:
|
||||
// It must be done after setting the highlighter
|
||||
// it must be done before SynEdit.EndUpdate, otherwise Leftchar may be wrongly adjusted
|
||||
if NewSrcEditorCreated then
|
||||
SourceNotebook.Notebook.PageIndex := AnUnitInfo.EditorIndex;
|
||||
|
||||
// mark unit as loaded
|
||||
NewSrcEdit.EditorComponent.EndUpdate;
|
||||
AnUnitInfo.Loaded:=true;
|
||||
|
Loading…
Reference in New Issue
Block a user