From 6d32a9abda05b5ab0368c6c97895073d7dd7de1a Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Sat, 26 Jul 2008 11:21:28 +0000 Subject: Update from Yuval Papish in Feature Request #2023217 Improved handling of the ~ sign. It recognizes special character handling using ~, e.g.: ~" Also a better support for line continuation. --- src/LexProgress.cxx | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/LexProgress.cxx b/src/LexProgress.cxx index 3b3a44541..c21356960 100644 --- a/src/LexProgress.cxx +++ b/src/LexProgress.cxx @@ -65,21 +65,24 @@ static void Colourise4glDoc(unsigned int startPos, int length, int initStyle, Wo // Handle line continuation generically. if (sc.ch == '~') { - // Skip whitespace between ~ and EOL - /* do { + if (sc.chNext > ' ') { + // skip special char after ~ sc.Forward(); - } */ - while ((sc.chNext == ' ' || sc.chNext == '\t') ) { - sc.Forward(); - sc.More(); + continue; } - if (sc.chNext == '\n' || sc.chNext == '\r') { - sc.Forward(); - if (sc.ch == '\r' && sc.chNext == '\n') { + else { + // Skip whitespace between ~ and EOL + while (sc.More() && (sc.chNext == ' ' || sc.chNext == '\t') ) { sc.Forward(); } - sc.Forward(); - continue; + if (sc.chNext == '\n' || sc.chNext == '\r') { + sc.Forward(); + if (sc.ch == '\r' && sc.chNext == '\n') { + sc.Forward(); + } + sc.Forward(); + continue; + } } } // Determine if a new state should be terminated. @@ -269,3 +272,5 @@ static const char * const FglWordLists[] = { }; LexerModule lmProgress(SCLEX_PS, Colourise4glDoc, "progress", Fold4glDoc, FglWordLists); + + -- cgit v1.2.3