diff --git a/ChangeLog b/ChangeLog index 6f59c2b7..70fe08a9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2011-04-08 Colomban Wendling + + * scintilla/lexers/LexCPP.cxx: + Make hightlighting of triple-quoted verbatim an option (Backport + from Scintilla HG 3602:5536ed81a85b). + + 2011-04-05 Nick Treleaven * src/templates.c: diff --git a/scintilla/lexers/LexCPP.cxx b/scintilla/lexers/LexCPP.cxx index f573befa..fa511b5f 100644 --- a/scintilla/lexers/LexCPP.cxx +++ b/scintilla/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 { 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, @@ -758,7 +763,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))) {