mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-20 17:40:40 +02:00
SynEdit: Fix auto fold on load $REGION /fold
git-svn-id: trunk@25903 -
This commit is contained in:
parent
2cec83d068
commit
e29f6a7a65
@ -173,6 +173,7 @@ type
|
|||||||
sfEnsureCursorPos, sfEnsureCursorPosAtResize,
|
sfEnsureCursorPos, sfEnsureCursorPosAtResize,
|
||||||
sfIgnoreNextChar, sfPainting, sfHasScrolled,
|
sfIgnoreNextChar, sfPainting, sfHasScrolled,
|
||||||
sfScrollbarChanged, sfHorizScrollbarVisible, sfVertScrollbarVisible,
|
sfScrollbarChanged, sfHorizScrollbarVisible, sfVertScrollbarVisible,
|
||||||
|
sfAfterLoadFromFile,
|
||||||
// Mouse-states
|
// Mouse-states
|
||||||
sfDblClicked, sfGutterClick, sfTripleClicked, sfQuadClicked,
|
sfDblClicked, sfGutterClick, sfTripleClicked, sfQuadClicked,
|
||||||
sfWaitForDragging, sfIsDragging, sfMouseSelecting, sfMouseDoneSelecting,
|
sfWaitForDragging, sfIsDragging, sfMouseSelecting, sfMouseDoneSelecting,
|
||||||
@ -1813,6 +1814,8 @@ begin
|
|||||||
try
|
try
|
||||||
if (FPaintLock=1) and HandleAllocated then begin
|
if (FPaintLock=1) and HandleAllocated then begin
|
||||||
ScanRanges;
|
ScanRanges;
|
||||||
|
if sfAfterLoadFromFile in fStateFlags then
|
||||||
|
AfterLoadFromFile;
|
||||||
if FChangedLinesStart > 0 then begin
|
if FChangedLinesStart > 0 then begin
|
||||||
InvalidateLines(FChangedLinesStart, FChangedLinesEnd);
|
InvalidateLines(FChangedLinesStart, FChangedLinesEnd);
|
||||||
InvalidateGutterLines(FChangedLinesStart, FChangedLinesEnd);
|
InvalidateGutterLines(FChangedLinesStart, FChangedLinesEnd);
|
||||||
@ -4110,6 +4113,8 @@ begin
|
|||||||
Application.RemoveOnIdleHandler(@IdleScanRanges);
|
Application.RemoveOnIdleHandler(@IdleScanRanges);
|
||||||
inherited CreateHandle; //SizeOrFontChanged will be called
|
inherited CreateHandle; //SizeOrFontChanged will be called
|
||||||
ScanRanges;
|
ScanRanges;
|
||||||
|
if sfAfterLoadFromFile in fStateFlags then
|
||||||
|
AfterLoadFromFile;
|
||||||
UpdateScrollBars;
|
UpdateScrollBars;
|
||||||
//if fStateFlags * [sfEnsureCursorPos, sfEnsureCursorPosAtResize] <> [] then
|
//if fStateFlags * [sfEnsureCursorPos, sfEnsureCursorPosAtResize] <> [] then
|
||||||
// EnsureCursorPosVisible;
|
// EnsureCursorPosVisible;
|
||||||
@ -6471,6 +6476,13 @@ end;
|
|||||||
|
|
||||||
procedure TCustomSynEdit.AfterLoadFromFile;
|
procedure TCustomSynEdit.AfterLoadFromFile;
|
||||||
begin
|
begin
|
||||||
|
if (not HandleAllocated) or
|
||||||
|
( (FPaintLock > 0) and not((FPaintLock = 1) and FIsInDecPaintLock) )
|
||||||
|
then begin
|
||||||
|
Include(fStateFlags, sfAfterLoadFromFile);
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
Exclude(fStateFlags, sfAfterLoadFromFile);
|
||||||
if assigned(FFoldedLinesView) then begin
|
if assigned(FFoldedLinesView) then begin
|
||||||
// TODO: Maybe defer until after paintlock?
|
// TODO: Maybe defer until after paintlock?
|
||||||
ScanRanges;
|
ScanRanges;
|
||||||
|
Loading…
Reference in New Issue
Block a user