summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2011-12-28 18:52:35 +0000
committerMaxime Coste <frrrwww@gmail.com>2011-12-28 18:52:35 +0000
commitc9ac4d615d5a52b07c3bdacac3e1a3c2fe6c48b5 (patch)
treeb823b726eb5d880d0f28407eb221f25ab7241f41 /src
parent0e398566d2069663a0f8075e9483afed513be10c (diff)
Highlighters: tweak colorize_cplusplus
Diffstat (limited to 'src')
-rw-r--r--src/highlighters.cc19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/highlighters.cc b/src/highlighters.cc
index bb400640..9767755f 100644
--- a/src/highlighters.cc
+++ b/src/highlighters.cc
@@ -99,15 +99,6 @@ HighlighterAndId colorize_regex_factory(Window& window,
void colorize_cplusplus(DisplayBuffer& display_buffer)
{
- static boost::regex preprocessor("(\\`|(?<=\\n))\\h*#\\h*[^\\n]*");
- colorize_regex(display_buffer, preprocessor, Color::Magenta);
-
- static boost::regex comments("//[^\\n]*\\n");
- colorize_regex(display_buffer, comments, Color::Cyan);
-
- static boost::regex strings("(?<!')\"(\\\\\"|[^\"])*\"");
- colorize_regex(display_buffer, strings, Color::Magenta);
-
static boost::regex values("\\<(true|false|NULL|nullptr)\\>|\\<-?\\d+[fdiu]?|'\\\\?[^']?'");
colorize_regex(display_buffer, values, Color::Red);
@@ -122,6 +113,16 @@ void colorize_cplusplus(DisplayBuffer& display_buffer)
static boost::regex types_keywords("\\<(const|auto|namespace|static|volatile|class|struct|enum|union|public|protected|private|template|typedef|virtual)\\>");
colorize_regex(display_buffer, types_keywords, Color::Green);
+
+ static boost::regex strings("(?<!')\"(\\\\\"|[^\"])*\"");
+ colorize_regex(display_buffer, strings, Color::Magenta);
+
+ static boost::regex preprocessor("(\\`|(?<=\\n))\\h*#\\h*[^\\n]*");
+ colorize_regex(display_buffer, preprocessor, Color::Magenta);
+
+ static boost::regex comments("(//[^\\n]*\\n)|(/\\*.*?(\\*/|\\'))");
+ colorize_regex(display_buffer, comments, Color::Cyan);
+
}
void expand_tabulations(DisplayBuffer& display_buffer)