mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-23 22:40:03 +02:00
parent
86a85a3be4
commit
591db7a660
@ -41,6 +41,15 @@ located at http://SynEdit.SourceForge.net
|
|||||||
Start or End of a FoldBlock
|
Start or End of a FoldBlock
|
||||||
*)
|
*)
|
||||||
|
|
||||||
|
(* TODO : Workaround for bug #20850
|
||||||
|
Remove when FPC 2.6.2 is out
|
||||||
|
*)
|
||||||
|
{$IFDEF CPU64}
|
||||||
|
{$IF (FPC_FULLVERSION = 2060) or (FPC_FULLVERSION = 20501)}
|
||||||
|
{$DEFINE ISSUE_20850 }
|
||||||
|
{$ENDIF}
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
unit SynEditHighlighterFoldBase;
|
unit SynEditHighlighterFoldBase;
|
||||||
|
|
||||||
{$I synedit.inc}
|
{$I synedit.inc}
|
||||||
@ -716,18 +725,36 @@ end;
|
|||||||
|
|
||||||
function TSynCustomFoldHighlighter.FoldBlockOpeningCount(ALineIndex: TLineIdx;
|
function TSynCustomFoldHighlighter.FoldBlockOpeningCount(ALineIndex: TLineIdx;
|
||||||
const AFilter: TSynFoldBlockFilter): integer;
|
const AFilter: TSynFoldBlockFilter): integer;
|
||||||
|
{$IFDEF ISSUE_20850}
|
||||||
|
var x : integer;
|
||||||
|
{$ENDIF}
|
||||||
begin
|
begin
|
||||||
if (ALineIndex < 0) or (ALineIndex >= CurrentLines.Count) then
|
if (ALineIndex < 0) or (ALineIndex >= CurrentLines.Count) then
|
||||||
exit(0);
|
exit(0);
|
||||||
|
{$IFDEF ISSUE_20850}
|
||||||
|
x := FoldBlockEndLevel(ALineIndex, AFilter);
|
||||||
|
Result := FoldBlockMinLevel(ALineIndex, AFilter);
|
||||||
|
Result := x - Result;
|
||||||
|
{$ELSE}
|
||||||
Result := FoldBlockEndLevel(ALineIndex, AFilter) - FoldBlockMinLevel(ALineIndex, AFilter);
|
Result := FoldBlockEndLevel(ALineIndex, AFilter) - FoldBlockMinLevel(ALineIndex, AFilter);
|
||||||
|
{$ENDIF}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TSynCustomFoldHighlighter.FoldBlockClosingCount(ALineIndex: TLineIdx;
|
function TSynCustomFoldHighlighter.FoldBlockClosingCount(ALineIndex: TLineIdx;
|
||||||
const AFilter: TSynFoldBlockFilter): integer;
|
const AFilter: TSynFoldBlockFilter): integer;
|
||||||
|
{$IFDEF ISSUE_20850}
|
||||||
|
var x : integer;
|
||||||
|
{$ENDIF}
|
||||||
begin
|
begin
|
||||||
if (ALineIndex < 0) or (ALineIndex >= CurrentLines.Count) then
|
if (ALineIndex < 0) or (ALineIndex >= CurrentLines.Count) then
|
||||||
exit(0);
|
exit(0);
|
||||||
|
{$IFDEF ISSUE_20850}
|
||||||
|
x := FoldBlockEndLevel(ALineIndex - 1, AFilter);
|
||||||
|
Result := FoldBlockMinLevel(ALineIndex, AFilter);
|
||||||
|
Result := x - Result;
|
||||||
|
{$ELSE}
|
||||||
Result := FoldBlockEndLevel(ALineIndex - 1, AFilter) - FoldBlockMinLevel(ALineIndex, AFilter);
|
Result := FoldBlockEndLevel(ALineIndex - 1, AFilter) - FoldBlockMinLevel(ALineIndex, AFilter);
|
||||||
|
{$ENDIF}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TSynCustomFoldHighlighter.FoldBlockEndLevel(ALineIndex: TLineIdx;
|
function TSynCustomFoldHighlighter.FoldBlockEndLevel(ALineIndex: TLineIdx;
|
||||||
|
Loading…
Reference in New Issue
Block a user