mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-06-03 04:58:22 +02:00
SourceEditor: Fix get correct Editor, do not use nil object (Beautifier callback).
git-svn-id: trunk@39603 -
This commit is contained in:
parent
b00e519138
commit
60e115de93
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user