From 6eae9775126ae096a93f516ba32074571a0489fc Mon Sep 17 00:00:00 2001 From: Johannes Sixt Date: Thu, 7 Jun 2007 22:12:53 +0200 Subject: [PATCH] Syntax highlighter: Highlight preprocessor lines. --- kdbg/sourcewnd.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/kdbg/sourcewnd.cpp b/kdbg/sourcewnd.cpp index 1e430cf..a59a4ef 100644 --- a/kdbg/sourcewnd.cpp +++ b/kdbg/sourcewnd.cpp @@ -792,6 +792,13 @@ int HighlightCpp::highlightParagraph(const QString& text, int state) if (state == -2) // initial state state = 0; + // check for preprocessor line + if (state == 0 && text.stripWhiteSpace().startsWith("#")) + { + setFormat(0, text.length(), QColor("dark green")); + return 0; + } + unsigned start = 0; while (start < text.length()) { -- 2.11.4.GIT