SourceEdit: Starting (alpha): show current class/proc header even if scrolled out

git-svn-id: trunk@34884 -
This commit is contained in:
martin 2012-01-23 13:06:11 +00:00
parent 758d5403ef
commit d1a81f63bd

View File

@ -395,8 +395,10 @@ begin
FSrcSynCaretChangedLock := True;
try
InfCnt := TextView.OpenFoldCount(CaretY-1);
ListCnt := 0;
if CaretY >= TopLine then begin
InfCnt := TextView.OpenFoldCount(CaretY-1);
for i := InfCnt-1 downto 0 do begin
Inf := TextView.OpenFoldInfo(CaretY-1, i);
if sfaInvalid in Inf.HNode.FoldAction then
@ -414,9 +416,14 @@ begin
if (TPascalCodeFoldBlockType(Inf.HNode.FoldType) in [cfbtProcedure]) and (ListCnt < 2) then begin
InfList[ListCnt] := Inf;
if ListCnt = 0 then
inc(ListCnt);
end;
if (TPascalCodeFoldBlockType(Inf.HNode.FoldType) in [cfbtProcedure]) and (ListCnt = 2) and
(TPascalCodeFoldBlockType(InfList[ListCnt-1].HNode.FoldType) = cfbtProcedure)
then begin
InfList[ListCnt-1] := Inf;
end;
end;
end;
t := TopLine + ListCnt - TSourceLazSynSurfaceManager(FPaintArea).TopLineCount;