SynEdit, Beautifier: Renamed OnDesiredIndentNeeded / Fixed Log-Caret

git-svn-id: trunk@20486 -
This commit is contained in:
martin 2009-06-06 18:08:31 +00:00
parent 56629b80c6
commit d891e19daf

View File

@ -44,14 +44,14 @@ uses
type type
TSynBeautifierDesiredIndentNeededEvent = TSynBeautifierGetIndentEvent =
procedure(Sender: TObject; PhysCaret: TPoint; var Indent, BasedLine: Integer) of object; procedure(Sender: TObject; LogCaret: TPoint; var Indent, BasedLine: Integer) of object;
{ TSynCustomBeautifier } { TSynCustomBeautifier }
TSynCustomBeautifier = class(TComponent) TSynCustomBeautifier = class(TComponent)
private private
FOnDesiredIndentNeeded: TSynBeautifierDesiredIndentNeededEvent; FOnDesiredIndentNeeded: TSynBeautifierGetIndentEvent;
public public
function CanUnindent(const Editor: TSynEditBase; const Lines: TSynEditStrings; function CanUnindent(const Editor: TSynEditBase; const Lines: TSynEditStrings;
const ACaret: TSynEditCaret): Boolean; virtual; abstract; const ACaret: TSynEditCaret): Boolean; virtual; abstract;
@ -66,7 +66,7 @@ type
function GetDesiredIndentForLine(Editor: TSynEditBase; const Lines: TSynEditStrings; function GetDesiredIndentForLine(Editor: TSynEditBase; const Lines: TSynEditStrings;
const ACaret: TSynEditCaret; const ACaret: TSynEditCaret;
out DesiredIndent: String): Integer; virtual; abstract; out DesiredIndent: String): Integer; virtual; abstract;
property OnDesiredIndentNeeded: TSynBeautifierDesiredIndentNeededEvent property OnDesiredIndentNeeded: TSynBeautifierGetIndentEvent
read FOnDesiredIndentNeeded write FOnDesiredIndentNeeded; read FOnDesiredIndentNeeded write FOnDesiredIndentNeeded;
end; end;
@ -192,8 +192,8 @@ begin
until (BackCounter = 0) or (Temp <> ''); until (BackCounter = 0) or (Temp <> '');
FoundLine := BackCounter + 1; FoundLine := BackCounter + 1;
if assigned(OnDesiredIndentNeeded) then if assigned(FOnDesiredIndentNeeded) then
OnDesiredIndentNeeded(Editor, ACaret.LineCharPos, Result, FoundLine); FOnDesiredIndentNeeded(Editor, ACaret.LineBytePos, Result, FoundLine);
if Result < 0 then exit; if Result < 0 then exit;