mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-28 12:02:48 +02:00
SynEdit: enable matching node markup for html and xml. Issue #0023016
git-svn-id: trunk@50780 -
This commit is contained in:
parent
fa40a95924
commit
bfc71c54f9
@ -2523,18 +2523,21 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TSynHTMLSyn.IdentProc;
|
procedure TSynHTMLSyn.IdentProc;
|
||||||
|
var
|
||||||
|
R: LongInt;
|
||||||
begin
|
begin
|
||||||
case fRange of
|
case fRange of
|
||||||
rsKey:
|
rsKey:
|
||||||
begin
|
begin
|
||||||
fRange := rsParam;
|
fRange := rsParam;
|
||||||
fTokenID := IdentKind((fLine + Run));
|
fTokenID := IdentKind((fLine + Run));
|
||||||
if ((FMode = shmXHtml) or (not fSimpleTag)) then
|
R := Run;
|
||||||
if fLine[Run] = '/' then
|
|
||||||
EndHtmlNodeCodeFoldBlock(Run+1, copy(fline, Run+2, fStringLen-1))
|
|
||||||
else if fLine[Run] <> '!' then
|
|
||||||
StartHtmlNodeCodeFoldBlock(cfbtHtmlNode, Run, copy(fline, Run+1, fStringLen));
|
|
||||||
Inc(Run, fStringLen);
|
Inc(Run, fStringLen);
|
||||||
|
if ((FMode = shmXHtml) or (not fSimpleTag)) then
|
||||||
|
if fLine[R] = '/' then
|
||||||
|
EndHtmlNodeCodeFoldBlock(R+1, copy(fline, R+2, fStringLen-1))
|
||||||
|
else if fLine[R] <> '!' then
|
||||||
|
StartHtmlNodeCodeFoldBlock(cfbtHtmlNode, R, copy(fline, R+1, fStringLen));
|
||||||
end;
|
end;
|
||||||
rsValue:
|
rsValue:
|
||||||
begin
|
begin
|
||||||
@ -2759,6 +2762,10 @@ function TSynHTMLSyn.GetFoldConfigInstance(Index: Integer): TSynCustomFoldConfig
|
|||||||
begin
|
begin
|
||||||
Result := inherited GetFoldConfigInstance(Index);
|
Result := inherited GetFoldConfigInstance(Index);
|
||||||
Result.Enabled := True;
|
Result.Enabled := True;
|
||||||
|
if THtmlCodeFoldBlockType(Index) in [cfbtHtmlNode] then begin
|
||||||
|
Result.SupportedModes := Result.SupportedModes + [fmMarkup];
|
||||||
|
Result.Modes := Result.Modes + [fmMarkup];
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TSynHTMLSyn.StartHtmlCodeFoldBlock(ABlockType: THtmlCodeFoldBlockType): TSynCustomCodeFoldBlock;
|
function TSynHTMLSyn.StartHtmlCodeFoldBlock(ABlockType: THtmlCodeFoldBlockType): TSynCustomCodeFoldBlock;
|
||||||
|
@ -747,6 +747,10 @@ function TSynXMLSyn.GetFoldConfigInstance(Index: Integer): TSynCustomFoldConfig;
|
|||||||
begin
|
begin
|
||||||
Result := inherited GetFoldConfigInstance(Index);
|
Result := inherited GetFoldConfigInstance(Index);
|
||||||
Result.Enabled := True;
|
Result.Enabled := True;
|
||||||
|
if TXmlCodeFoldBlockType(Index) in [cfbtXmlNode] then begin
|
||||||
|
Result.SupportedModes := Result.SupportedModes + [fmMarkup];
|
||||||
|
Result.Modes := Result.Modes + [fmMarkup];
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TSynXMLSyn.IdentProc;
|
procedure TSynXMLSyn.IdentProc;
|
||||||
|
Loading…
Reference in New Issue
Block a user