Browse Source

Add GetAnchorPosition.

Martijn Laan 1 month ago
parent
commit
a257ee06df
1 changed files with 7 additions and 0 deletions
  1. 7 0
      Components/ScintEdit.pas

+ 7 - 0
Components/ScintEdit.pas

@@ -138,6 +138,7 @@ type
     FWordWrap: Boolean;
     FWordWrap: Boolean;
     procedure ApplyOptions;
     procedure ApplyOptions;
     procedure ForwardMessage(const Message: TMessage);
     procedure ForwardMessage(const Message: TMessage);
+    function GetAnchorPosition: Integer;
     function GetAutoCompleteActive: Boolean;
     function GetAutoCompleteActive: Boolean;
     function GetCallTipActive: Boolean;
     function GetCallTipActive: Boolean;
     function GetCaretColumn: Integer;
     function GetCaretColumn: Integer;
@@ -373,6 +374,7 @@ type
     function WordAtCaretRange: TScintRange;
     function WordAtCaretRange: TScintRange;
     procedure ZoomIn;
     procedure ZoomIn;
     procedure ZoomOut;
     procedure ZoomOut;
+    property AnchorPosition: Integer read GetAnchorPosition;
     property AutoCompleteActive: Boolean read GetAutoCompleteActive;
     property AutoCompleteActive: Boolean read GetAutoCompleteActive;
     property CallTipActive: Boolean read GetCallTipActive;
     property CallTipActive: Boolean read GetCallTipActive;
     property CaretColumn: Integer read GetCaretColumn write SetCaretColumn;
     property CaretColumn: Integer read GetCaretColumn write SetCaretColumn;
@@ -982,6 +984,11 @@ begin
     CallWindowProc(DefWndProc, Handle, Message.Msg, Message.WParam, Message.LParam);
     CallWindowProc(DefWndProc, Handle, Message.Msg, Message.WParam, Message.LParam);
 end;
 end;
 
 
+function TScintEdit.GetAnchorPosition: Integer;
+begin
+  Result := Call(SCI_GETANCHOR, 0, 0);
+end;
+
 function TScintEdit.GetAutoCompleteActive: Boolean;
 function TScintEdit.GetAutoCompleteActive: Boolean;
 begin
 begin
   Result := Call(SCI_AUTOCACTIVE, 0, 0) <> 0;
   Result := Call(SCI_AUTOCACTIVE, 0, 0) <> 0;