diff options
author | nyamatongwe <unknown> | 2008-07-26 11:21:28 +0000 |
---|---|---|
committer | nyamatongwe <unknown> | 2008-07-26 11:21:28 +0000 |
commit | 6d32a9abda05b5ab0368c6c97895073d7dd7de1a (patch) | |
tree | 235f7048216ac6af73af2e440494d91f2c1ef8a0 | |
parent | 5ed3ea5a7efdbdf41e035d0ae25f26ff8107cb48 (diff) | |
download | scintilla-mirror-6d32a9abda05b5ab0368c6c97895073d7dd7de1a.tar.gz |
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.
-rw-r--r-- | src/LexProgress.cxx | 27 |
1 files changed, 16 insertions, 11 deletions
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); + + |