aboutsummaryrefslogtreecommitdiffhomepage
path: root/lexers/LexCPP.cxx
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2017-06-22 17:43:56 +1000
committerNeil <nyamatongwe@gmail.com>2017-06-22 17:43:56 +1000
commit3a993f0a5e97435874e06d5496085c4cb7a0d4cb (patch)
treef1bfbd0aa566e23e67d9340f5fde763ba3621278 /lexers/LexCPP.cxx
parent6c72bb1aba1b8b0cea4bd5360f94847316166a92 (diff)
downloadscintilla-mirror-3a993f0a5e97435874e06d5496085c4cb7a0d4cb.tar.gz
Backport: Add style metadata methods with null implementations.
Backport based on changesets 6345:faecbd0078e5 and 6346:72bd27f81477.
Diffstat (limited to 'lexers/LexCPP.cxx')
-rw-r--r--lexers/LexCPP.cxx20
1 files changed, 16 insertions, 4 deletions
diff --git a/lexers/LexCPP.cxx b/lexers/LexCPP.cxx
index 238856b1c..fc42bce54 100644
--- a/lexers/LexCPP.cxx
+++ b/lexers/LexCPP.cxx
@@ -413,7 +413,7 @@ struct OptionSetCPP : public OptionSet<OptionsCPP> {
DefineProperty("fold.cpp.explicit.anywhere", &OptionsCPP::foldExplicitAnywhere,
"Set this property to 1 to enable explicit fold points anywhere, not just in line comments.");
-
+
DefineProperty("fold.cpp.preprocessor.at.else", &OptionsCPP::foldPreprocessorAtElse,
"This option enables folding on a preprocessor #else or #endif line of an #if statement.");
@@ -434,7 +434,7 @@ const char styleSubable[] = {SCE_C_IDENTIFIER, SCE_C_COMMENTDOCKEYWORD, 0};
}
-class LexerCPP : public ILexerWithSubStyles {
+class LexerCPP : public ILexerWithMetaData {
bool caseSensitive;
CharacterSet setWord;
CharacterSet setNegationOp;
@@ -489,7 +489,7 @@ public:
delete this;
}
int SCI_METHOD Version() const override {
- return lvSubStyles;
+ return lvMetaData;
}
const char * SCI_METHOD PropertyNames() override {
return osCPP.PropertyNames();
@@ -545,6 +545,18 @@ public:
const char * SCI_METHOD GetSubStyleBases() override {
return styleSubable;
}
+ int SCI_METHOD NamedStyles() {
+ return 0;
+ }
+ const char * SCI_METHOD NameOfStyle(int) {
+ return "";
+ }
+ const char * SCI_METHOD TagsOfStyle(int) {
+ return "";
+ }
+ const char * SCI_METHOD DescriptionOfStyle(int) {
+ return "";
+ }
static ILexer *LexerFactoryCPP() {
return new LexerCPP(true);
@@ -1354,7 +1366,7 @@ void SCI_METHOD LexerCPP::Fold(Sci_PositionU startPos, Sci_Position length, int
} else if (styler.Match(j, "end")) {
levelNext--;
}
-
+
if (options.foldPreprocessorAtElse && (styler.Match(j, "else") || styler.Match(j, "elif"))) {
levelMinCurrent--;
}