mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-23 08:19:41 +02:00
SynEdit, Markup outline: fix crash after enabling outline (when IDE started with it disabled)
git-svn-id: trunk@58840 -
This commit is contained in:
parent
5570f33576
commit
9a1584ac60
@ -560,13 +560,13 @@ end;
|
||||
|
||||
procedure TSynEditMarkupFoldColors.TextBufferChanged(pSender: TObject);
|
||||
begin
|
||||
if pSender <> nil then
|
||||
TSynEditStrings(pSender).Ranges[Self] := nil;
|
||||
|
||||
if not Enabled then
|
||||
exit;
|
||||
InitNestList;
|
||||
|
||||
if pSender <> nil then
|
||||
TSynEditStrings(pSender).Ranges[Self] := nil;
|
||||
|
||||
FColumnCache.Capacity := SynEdit.Lines.Capacity;
|
||||
FColumnCache.Count := SynEdit.Lines.Count;
|
||||
Lines.Ranges[Self] := FColumnCache;
|
||||
@ -1203,7 +1203,7 @@ begin
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
if Lines <> nil then begin
|
||||
if (Lines <> nil) and Enabled then begin
|
||||
FColumnCache.Capacity := Lines.Capacity;
|
||||
FColumnCache.Count := Lines.Count;
|
||||
Lines.Ranges[Self] := FColumnCache;
|
||||
@ -1266,11 +1266,21 @@ begin
|
||||
// remove Changehandler
|
||||
Lines.RemoveChangeHandler(senrHighlightChanged, @HighlightChanged);
|
||||
Lines.RemoveNotifyHandler(senrTextBufferChanged, @TextBufferChanged);
|
||||
FColumnCache.Invalidate;
|
||||
end;
|
||||
end;
|
||||
if Assigned(Lines) then
|
||||
|
||||
if Assigned(Lines) then begin
|
||||
if Enabled then begin
|
||||
FColumnCache.Capacity := Lines.Capacity;
|
||||
FColumnCache.Count := Lines.Count;
|
||||
Lines.Ranges[Self] := FColumnCache;
|
||||
FColumnCache.Invalidate;
|
||||
end
|
||||
else
|
||||
Lines.Ranges[Self] := nil;
|
||||
|
||||
InvalidateSynLines(1, Lines.Count);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TSynEditMarkupFoldColors.ColorChanged(pMarkup: TObject);
|
||||
|
Loading…
Reference in New Issue
Block a user