aboutsummaryrefslogtreecommitdiffhomepage
path: root/lexers/LexCPP.cxx
diff options
context:
space:
mode:
authornyamatongwe <unknown>2011-04-05 09:31:51 +1000
committernyamatongwe <unknown>2011-04-05 09:31:51 +1000
commitde6567907167d00f480d3353e62b714b5a6bab19 (patch)
treee6a55c7b5d6021290b3df735be113008b8f8dd48 /lexers/LexCPP.cxx
parent0f4acb26a5c0ea7f2d233418ba30900e5e141980 (diff)
downloadscintilla-mirror-de6567907167d00f480d3353e62b714b5a6bab19.tar.gz
Make highlight of triple-quoted an option. Bug #3239234.
Property name is lexer.cpp.triplequoted.strings. From Marko Njezic.
Diffstat (limited to 'lexers/LexCPP.cxx')
-rw-r--r--lexers/LexCPP.cxx7
1 files changed, 6 insertions, 1 deletions
diff --git a/lexers/LexCPP.cxx b/lexers/LexCPP.cxx
index 0d5f2afb7..65525a679 100644
--- a/lexers/LexCPP.cxx
+++ b/lexers/LexCPP.cxx
@@ -208,6 +208,7 @@ struct OptionsCPP {
bool identifiersAllowDollars;
bool trackPreprocessor;
bool updatePreprocessor;
+ bool triplequotedStrings;
bool fold;
bool foldSyntaxBased;
bool foldComment;
@@ -224,6 +225,7 @@ struct OptionsCPP {
identifiersAllowDollars = true;
trackPreprocessor = true;
updatePreprocessor = true;
+ triplequotedStrings = false;
fold = false;
foldSyntaxBased = true;
foldComment = false;
@@ -263,6 +265,9 @@ struct OptionSetCPP : public OptionSet<OptionsCPP> {
DefineProperty("lexer.cpp.update.preprocessor", &OptionsCPP::updatePreprocessor,
"Set to 1 to update preprocessor definitions when #define found.");
+ DefineProperty("lexer.cpp.triplequoted.strings", &OptionsCPP::triplequotedStrings,
+ "Set to 1 to enable highlighting of triple-quoted strings.");
+
DefineProperty("fold", &OptionsCPP::fold);
DefineProperty("fold.cpp.syntax.based", &OptionsCPP::foldSyntaxBased,
@@ -760,7 +765,7 @@ void SCI_METHOD LexerCPP::Lex(unsigned int startPos, int length, int initStyle,
if (sc.Match('@', '\"')) {
sc.SetState(SCE_C_VERBATIM|activitySet);
sc.Forward();
- } else if (sc.Match("\"\"\"")) {
+ } else if (options.triplequotedStrings && sc.Match("\"\"\"")) {
sc.SetState(SCE_C_TRIPLEVERBATIM|activitySet);
sc.Forward(2);
} else if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext))) {