SynEdit, Fixed fold-context menu. Some items would not show, if begin-end blocks were not folded. issue #13576

git-svn-id: trunk@19602 -
This commit is contained in:
martin 2009-04-24 10:12:20 +00:00
parent 4ff5a5562a
commit 468a0e145f
3 changed files with 9 additions and 4 deletions

View File

@ -2210,6 +2210,8 @@ begin
n := o;
for i := hl.FoldNodeInfoCount[aStartIndex] - 1 downto 0 do begin
nd := hl.FoldNodeInfo[aStartIndex, i];
if not(sfaFold in nd.FoldAction) then
continue;
t := nd.FoldGroup;
if sfaOpen in nd.FoldAction then begin
dec(n);

View File

@ -101,6 +101,7 @@ type
TSynFoldAction = (sfaOpen, // At this node a new Fold can start
sfaClose, // At this node a fold ends
sfaMarkup, // This node can be highlighted, by the matching Word-Pair Markup
sfaFold, // Part of a foldable block
sfaInvalid // Wrong Index
);
TSynFoldActions = set of TSynFoldAction;

View File

@ -2767,8 +2767,9 @@ begin
if FCatchNodeInfo then begin // exclude subblocks, because they do not increase the foldlevel yet
GrowNodeInfoList;
InitNode(FNodeInfoList[FNodeInfoCount], +1, ABlockType);
// if not SubBlock then
include(FNodeInfoList[FNodeInfoCount].FoldAction, sfaOpen);
if FoldBlock then
include(FNodeInfoList[FNodeInfoCount].FoldAction, sfaFold);
include(FNodeInfoList[FNodeInfoCount].FoldAction, sfaOpen);
inc(FNodeInfoCount);
end;
if not FoldBlock then
@ -2783,8 +2784,9 @@ begin
if FCatchNodeInfo then begin // exclude subblocks, because they do not increase the foldlevel yet
GrowNodeInfoList;
InitNode(FNodeInfoList[FNodeInfoCount], -1, TopPascalCodeFoldBlockType);
// if DecreaseLevel then
include(FNodeInfoList[FNodeInfoCount].FoldAction, sfaClose);
if DecreaseLevel then
include(FNodeInfoList[FNodeInfoCount].FoldAction, sfaFold);
include(FNodeInfoList[FNodeInfoCount].FoldAction, sfaClose);
inc(FNodeInfoCount);
end;
inherited EndCodeFoldBlock(DecreaseLevel);