mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-18 06:19:32 +02:00
SynEdit, fold highlighter: added sfaSingleLine, sfamultiLine
git-svn-id: trunk@37901 -
This commit is contained in:
parent
4d231202ee
commit
6164890dca
@ -67,18 +67,26 @@ type
|
|||||||
|
|
||||||
TSynFoldAction = ( sfaOpen, // Any Opening node
|
TSynFoldAction = ( sfaOpen, // Any Opening node
|
||||||
sfaClose, // Any Closing node
|
sfaClose, // Any Closing node
|
||||||
|
|
||||||
|
sfaFold, // Part of a fold- or hide-able block (FoldConf.Enabled = True) - excludes one=liners for FoldFold, as they can not fold
|
||||||
|
sfaFoldFold, // Part of a fold-able block (FoldConf.Enabled = True / smFold in Modes) - excludes one=liners / only opening node (todo: maybe both?)
|
||||||
|
sfaFoldHide, // Part of a hide-able block (FoldConf.Enabled = True / smHide in Modes) - includes one=liners / only opening node (todo: maybe both?)
|
||||||
|
|
||||||
|
sfaMultiLine, // The closing node is on an other line
|
||||||
|
sfaSingleLine, // The closing node is on the same line (though the keyword may be on the next)
|
||||||
|
// //sfaSingleLineClosedByNext
|
||||||
|
sfaCloseForNextLine, // Fold closes this line, but keyword is on the next (e.g. "var" block)
|
||||||
|
sfaLastLineClose, // Fold is incomplete, and closed at last line of file
|
||||||
|
|
||||||
|
sfaDefaultCollapsed,
|
||||||
|
sfaMarkup, // This node can be highlighted, by the matching Word-Pair Markup
|
||||||
|
sfaInvalid, // Wrong Index
|
||||||
|
|
||||||
|
// TODO: deprecate
|
||||||
sfaOpenFold, // At this node a new Fold can start // Actually, includes all,any multiline node too.
|
sfaOpenFold, // At this node a new Fold can start // Actually, includes all,any multiline node too.
|
||||||
sfaCloseFold, // At this node a fold ends
|
sfaCloseFold, // At this node a fold ends
|
||||||
sfaFold, // Part of a fold- or hide-able block (FoldConf.Enabled = True) - excludes one=liners for FoldFold, as they can not fold
|
|
||||||
sfaFoldFold, // Part of a fold-able block (FoldConf.Enabled = True / smFold in Modes) - excludes one=liners / only opening node (todo: maybe both?)
|
|
||||||
sfaFoldHide, // Part of a hide-able block (FoldConf.Enabled = True / smHide in Modes) - includes one=liners / only opening node (todo: maybe both?)
|
|
||||||
sfaInvalid, // Wrong Index
|
|
||||||
sfaMarkup, // This node can be highlighted, by the matching Word-Pair Markup
|
|
||||||
sfaDefaultCollapsed,
|
|
||||||
sfaOneLineOpen, // Open, but closes on same line; *only* if hide-able has [sfaOpenFold, sfaFold]; always has [sfaFoldFold, sfaFoldHide]
|
sfaOneLineOpen, // Open, but closes on same line; *only* if hide-able has [sfaOpenFold, sfaFold]; always has [sfaFoldFold, sfaFoldHide]
|
||||||
sfaOneLineClose, // Open, but closes on same line;
|
sfaOneLineClose // Open, but closes on same line;
|
||||||
sfaLastLineClose, // Fold is incomplete, and closed at last line of file
|
|
||||||
sfaCloseForNextLine // Fold closes this line, but keyword is on the next (e.g. "var" block)
|
|
||||||
);
|
);
|
||||||
TSynFoldActions = set of TSynFoldAction;
|
TSynFoldActions = set of TSynFoldAction;
|
||||||
|
|
||||||
|
@ -3398,6 +3398,7 @@ var
|
|||||||
i: Integer;
|
i: Integer;
|
||||||
nd: PSynFoldNodeInfo;
|
nd: PSynFoldNodeInfo;
|
||||||
begin
|
begin
|
||||||
|
aActions := aActions + [sfaMultiLine];
|
||||||
Node.LineIndex := LineIndex;
|
Node.LineIndex := LineIndex;
|
||||||
Node.LogXStart := Run;
|
Node.LogXStart := Run;
|
||||||
Node.LogXEnd := Run + fStringLen;
|
Node.LogXEnd := Run + fStringLen;
|
||||||
@ -3451,8 +3452,8 @@ begin
|
|||||||
nd := FCatchNodeInfoList.ItemPointer[i];
|
nd := FCatchNodeInfoList.ItemPointer[i];
|
||||||
end;
|
end;
|
||||||
if i >= 0 then begin
|
if i >= 0 then begin
|
||||||
nd^.FoldAction := nd^.FoldAction + [sfaOneLineOpen];
|
nd^.FoldAction := nd^.FoldAction + [sfaOneLineOpen, sfaSingleLine] - [sfaMultiLine];
|
||||||
Node.FoldAction := Node.FoldAction + [sfaOneLineClose];
|
Node.FoldAction := Node.FoldAction + [sfaOneLineClose, sfaSingleLine] - [sfaMultiLine];
|
||||||
if (sfaFoldHide in nd^.FoldAction) then begin
|
if (sfaFoldHide in nd^.FoldAction) then begin
|
||||||
assert(sfaFold in nd^.FoldAction, 'sfaFoldHide without sfaFold');
|
assert(sfaFold in nd^.FoldAction, 'sfaFoldHide without sfaFold');
|
||||||
// one liner: hide-able / not fold-able
|
// one liner: hide-able / not fold-able
|
||||||
|
Loading…
Reference in New Issue
Block a user