Make hightlighting of triple-quoted verbatim an option

Backport from Scintilla HG (3602:5536ed81a85b).

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5696 ea778897-0a13-0410-b9d1-a72fbfd435f5
This commit is contained in:
Colomban Wendling 2011-04-08 00:13:24 +00:00
parent 20bab74fd5
commit d6278f3381
2 changed files with 13 additions and 1 deletions

View File

@ -1,3 +1,10 @@
2011-04-08 Colomban Wendling <colomban(at)geany(dot)org>
* scintilla/lexers/LexCPP.cxx:
Make hightlighting of triple-quoted verbatim an option (Backport
from Scintilla HG 3602:5536ed81a85b).
2011-04-05 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
* src/templates.c:

View File

@ -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,
@ -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))) {