SynEdit: Added hcCodeFolding to highlighter capabilities

git-svn-id: trunk@40529 -
This commit is contained in:
martin 2013-03-10 21:07:08 +00:00
parent fe7799e167
commit 805036a7ba
2 changed files with 9 additions and 2 deletions

View File

@ -189,7 +189,8 @@ type
TSynHighlighterCapability = ( TSynHighlighterCapability = (
hcUserSettings, // supports Enum/UseUserSettings hcUserSettings, // supports Enum/UseUserSettings
hcRegistry // supports LoadFrom/SaveToRegistry hcRegistry, // supports LoadFrom/SaveToRegistry
hcCodeFolding
); );
TSynHighlighterCapabilities = set of TSynHighlighterCapability; TSynHighlighterCapabilities = set of TSynHighlighterCapability;

View File

@ -325,6 +325,7 @@ type
public public
constructor Create(AOwner: TComponent); override; constructor Create(AOwner: TComponent); override;
destructor Destroy; override; destructor Destroy; override;
class function GetCapabilities: TSynHighlighterCapabilities; override;
function GetRange: Pointer; override; function GetRange: Pointer; override;
// Info about Folds // Info about Folds
@ -757,7 +758,12 @@ begin
FFoldConfig := nil; FFoldConfig := nil;
end; end;
function TSynCustomFoldHighlighter.GetRange: pointer; class function TSynCustomFoldHighlighter.GetCapabilities: TSynHighlighterCapabilities;
begin
Result := inherited GetCapabilities + [hcCodeFolding];
end;
function TSynCustomFoldHighlighter.GetRange: Pointer;
begin begin
// FCodeFoldRange is the working range and changed steadily // FCodeFoldRange is the working range and changed steadily
// => return a fixed copy of the current CodeFoldRange instance, // => return a fixed copy of the current CodeFoldRange instance,