mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-10 09:35:59 +02:00
SourceEdit: Starting (alpha): show current class/proc header even if scrolled out
git-svn-id: trunk@34884 -
This commit is contained in:
parent
758d5403ef
commit
d1a81f63bd
@ -395,27 +395,34 @@ begin
|
||||
|
||||
FSrcSynCaretChangedLock := True;
|
||||
try
|
||||
InfCnt := TextView.OpenFoldCount(CaretY-1);
|
||||
ListCnt := 0;
|
||||
for i := InfCnt-1 downto 0 do begin
|
||||
Inf := TextView.OpenFoldInfo(CaretY-1, i);
|
||||
if sfaInvalid in Inf.HNode.FoldAction then
|
||||
continue;
|
||||
|
||||
if (TPascalCodeFoldBlockType(Inf.HNode.FoldType) in [cfbtClassSection]) and (ListCnt = 0) then begin
|
||||
InfList[ListCnt] := Inf;
|
||||
inc(ListCnt);
|
||||
end;
|
||||
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
|
||||
continue;
|
||||
|
||||
if (TPascalCodeFoldBlockType(Inf.HNode.FoldType) in [cfbtClass]) and (ListCnt < 2) then begin
|
||||
InfList[ListCnt] := Inf;
|
||||
inc(ListCnt);
|
||||
end;
|
||||
|
||||
if (TPascalCodeFoldBlockType(Inf.HNode.FoldType) in [cfbtProcedure]) and (ListCnt < 2) then begin
|
||||
InfList[ListCnt] := Inf;
|
||||
if ListCnt = 0 then
|
||||
if (TPascalCodeFoldBlockType(Inf.HNode.FoldType) in [cfbtClassSection]) and (ListCnt = 0) then begin
|
||||
InfList[ListCnt] := Inf;
|
||||
inc(ListCnt);
|
||||
end;
|
||||
|
||||
if (TPascalCodeFoldBlockType(Inf.HNode.FoldType) in [cfbtClass]) and (ListCnt < 2) then begin
|
||||
InfList[ListCnt] := Inf;
|
||||
inc(ListCnt);
|
||||
end;
|
||||
|
||||
if (TPascalCodeFoldBlockType(Inf.HNode.FoldType) in [cfbtProcedure]) and (ListCnt < 2) then begin
|
||||
InfList[ListCnt] := Inf;
|
||||
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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user