SourceEditor: Fix get correct Editor, do not use nil object (Beautifier callback).

git-svn-id: trunk@39603 -
This commit is contained in:
martin 2012-12-20 20:44:33 +00:00
parent b00e519138
commit 60e115de93

View File

@ -7911,7 +7911,12 @@ var
CodeBuf: TCodeBuffer;
begin
Result:=false;
SrcEdit := FindSourceEditorWithEditorComponent(TComponent(Editor));
// SynBeatifier is shared arrcoss SynEdits, and may call the wrong SrcNoteBook
if assigned(Manager)
then SrcEdit := Manager.FindSourceEditorWithEditorComponent(TComponent(Editor))
else SrcEdit := FindSourceEditorWithEditorComponent(TComponent(Editor));
if SrcEdit = nil then
exit;
if assigned(Manager) and Assigned(Manager.OnGetIndent) then begin
Result := Manager.OnGetIndent(Sender, SrcEdit, LogCaret, OldLogCaret, FirstLinePos, LastLinePos,
Reason, SetIndentProc);