SynEdit: Markup fold color, fix empty lines before "last line close", part of patch 20 from issue by Pascal R.

git-svn-id: trunk@54153 -
This commit is contained in:
martin 2017-02-14 19:24:17 +00:00
parent db9e91ddf7
commit 21853b8fc0

View File

@ -439,18 +439,23 @@ var
end;
end;
SetFoldColorInfosCount(FFoldColorInfosCount + 1);
with FFoldColorInfos[FFoldColorInfosCount - 1] do begin
Border := False;
SrcNode:= ANode; //needed by close node
Y := ANode.LineIndex + 1;
X := ANode.LogXStart + 1;
X2 := ANode.LogXEnd + 1;
Level := lvl;
if not (sfaOutlineNocolor in ANode.FoldAction) then
ColorIdx := Max(0, lvl) mod (length(Colors))
else
ColorIdx := -1;
// ignore implicit close nodes at end of line, especially if line is empty
// or at least has less characters as vertical line is on
if not(sfaCloseForNextLine in ANode.FoldAction) then begin
SetFoldColorInfosCount(FFoldColorInfosCount + 1);
with FFoldColorInfos[FFoldColorInfosCount - 1] do begin
Border := False;
SrcNode:= ANode; //needed by close node
Y := ANode.LineIndex + 1;
X := ANode.LogXStart + 1;
X2 := ANode.LogXEnd + 1;
Level := lvl;
if not (sfaOutlineNocolor in ANode.FoldAction) then
ColorIdx := Max(0, lvl) mod (length(Colors))
else
ColorIdx := -1;
end;
end;
end;