From 805036a7baf5edb4f291ab3665421544dd12d7dc Mon Sep 17 00:00:00 2001 From: martin Date: Sun, 10 Mar 2013 21:07:08 +0000 Subject: [PATCH] SynEdit: Added hcCodeFolding to highlighter capabilities git-svn-id: trunk@40529 - --- components/synedit/synedithighlighter.pp | 3 ++- components/synedit/synedithighlighterfoldbase.pas | 8 +++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/components/synedit/synedithighlighter.pp b/components/synedit/synedithighlighter.pp index 5e206d7119..6faa73031a 100644 --- a/components/synedit/synedithighlighter.pp +++ b/components/synedit/synedithighlighter.pp @@ -189,7 +189,8 @@ type TSynHighlighterCapability = ( hcUserSettings, // supports Enum/UseUserSettings - hcRegistry // supports LoadFrom/SaveToRegistry + hcRegistry, // supports LoadFrom/SaveToRegistry + hcCodeFolding ); TSynHighlighterCapabilities = set of TSynHighlighterCapability; diff --git a/components/synedit/synedithighlighterfoldbase.pas b/components/synedit/synedithighlighterfoldbase.pas index e6e369253f..3c4a852d31 100644 --- a/components/synedit/synedithighlighterfoldbase.pas +++ b/components/synedit/synedithighlighterfoldbase.pas @@ -325,6 +325,7 @@ type public constructor Create(AOwner: TComponent); override; destructor Destroy; override; + class function GetCapabilities: TSynHighlighterCapabilities; override; function GetRange: Pointer; override; // Info about Folds @@ -757,7 +758,12 @@ begin FFoldConfig := nil; end; -function TSynCustomFoldHighlighter.GetRange: pointer; +class function TSynCustomFoldHighlighter.GetCapabilities: TSynHighlighterCapabilities; +begin + Result := inherited GetCapabilities + [hcCodeFolding]; +end; + +function TSynCustomFoldHighlighter.GetRange: Pointer; begin // FCodeFoldRange is the working range and changed steadily // => return a fixed copy of the current CodeFoldRange instance,