SynEdit: Fixed/Workaround an issue with missing refresh (fold-line-mapping not updated), if no highlighter is assigned

git-svn-id: trunk@31852 -
This commit is contained in:
martin 2011-08-03 12:13:29 +00:00
parent 70e64e04d8
commit b61f745148
2 changed files with 7 additions and 2 deletions

View File

@ -4842,8 +4842,11 @@ begin
exit;
end;
if not assigned(FHighlighter) then begin
if ATextChanged then
if ATextChanged then begin
fMarkupManager.TextChanged(FChangedLinesStart, FChangedLinesEnd);
// TODO: see TSynEditFoldedView.LineCountChanged, this is only needed, because NeedFixFrom does not always work
FFoldedLinesView.FixFoldingAtTextIndex(FChangedLinesStart, FChangedLinesEnd);
end;
Topline := TopLine;
exit;
end;

View File

@ -3936,7 +3936,9 @@ procedure TSynEditFoldedView.LineCountChanged(Sender: TSynEditStrings; AIndex, A
begin
{$IFDEF SynFoldDebug}try DebugLnEnter(['>> FOLD-- LineCountChanged AIndex=', AIndex, ' Acount=',ACount]);{$ENDIF}
// no need for fix folding => synedit will be called, and scanlines will call fixfolding
{TODO: a "need fix folding" flag => to ensure it will be called if synedit doesnt}
{TODO: a "need fix folding" flag => to ensure it will be called if synedit doesnt
SynEdit.ScanRanges, calls Fixfolding as workaroound => review
}
if (fLockCount > 0) and (AIndex < max(fNeedFixFrom, fNeedFixMinEnd)) then begin
// adapt the fixfold range. Could be done smarter, but it doesn't matter if the range gets bigger than needed.
if (ACount < 0) and (AIndex < fNeedFixFrom) then inc(fNeedFixFrom, ACount);