summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/fpg_textedit.pas8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/fpg_textedit.pas b/src/fpg_textedit.pas
index e6aab639..8cd13a0c 100644
--- a/src/fpg_textedit.pas
+++ b/src/fpg_textedit.pas
@@ -157,6 +157,7 @@ type
procedure GetRowColAtPos(const X, Y: Integer; out Row, Col: Integer);
procedure Clear;
procedure ScrollTo(X, Y: Integer);
+ procedure GotoLine(ALine: integer);
procedure DeleteSelection;
procedure SaveToFile(const AFileName: TfpgString);
procedure LoadFromFile(const AFileName: TfpgString);
@@ -1719,6 +1720,13 @@ begin
SetHPos(X div FChrW);
end;
+procedure TfpgBaseTextEdit.GotoLine(ALine: integer);
+begin
+ CaretPos.X := 0;
+ CaretPos.Y := ALine;
+ ScrollPos_V := ALine-5; // scrolling a few lines short so cursor is not on top line
+end;
+
procedure TfpgBaseTextEdit.DeleteSelection;
begin
{ TODO : Implement DeleteSelection }