diff options
Diffstat (limited to 'examples/apps/ide/src/frm_main.pas')
-rw-r--r-- | examples/apps/ide/src/frm_main.pas | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/examples/apps/ide/src/frm_main.pas b/examples/apps/ide/src/frm_main.pas index f5adaec6..821bcbf0 100644 --- a/examples/apps/ide/src/frm_main.pas +++ b/examples/apps/ide/src/frm_main.pas @@ -684,6 +684,8 @@ var ext: TfpgString; pos_h: integer; pos_v: integer; + cur_pos_h: integer; + cur_pos_v: integer; editor: TfpgTextEdit; begin s := AFilename; @@ -702,10 +704,15 @@ begin editor := TfpgTextEdit(pcEditor.Pages[i].Components[0]); pos_h := editor.ScrollPos_H; pos_v := editor.ScrollPos_V; + cur_pos_h := editor.CaretPos_H; + cur_pos_v := editor.CaretPos_V; editor.Lines.BeginUpdate; editor.LoadFromFile(s); editor.ScrollPos_H := pos_h; editor.ScrollPos_V := pos_v; + editor.CaretPos_H := cur_pos_h; + editor.CaretPos_V := cur_pos_v; + editor.UpdateScrollBars; editor.Lines.EndUpdate; pcEditor.ActivePageIndex := i; ts := pcEditor.ActivePage; |