2011-07-11 21:43 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com)

* contrib/hbqt/qtgui/hbqt_hbqsyntaxhighlighter.cpp
    * Fixed: wrongly highlighted text where single-line comment 
      is inside the quoted text, viz., "ABC//DEF" which is greyed
      after "//", reported by Miso Pucko on the bug tracker.
This commit is contained in:
Pritpal Bedi
2011-07-12 04:47:32 +00:00
parent 2cc82ff942
commit bec2a3b39c
2 changed files with 20 additions and 6 deletions

View File

@@ -16,6 +16,12 @@
The license applies to all entries newer than 2009-04-28.
*/
2011-07-11 21:43 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com)
* contrib/hbqt/qtgui/hbqt_hbqsyntaxhighlighter.cpp
* Fixed: wrongly highlighted text where single-line comment
is inside the quoted text, viz., "ABC//DEF" which is greyed
after "//", reported by Miso Pucko on the bug tracker.
2011-07-12 00:10 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
* config/win/global.mk
* contrib/hbpost.hbm

View File

@@ -232,9 +232,11 @@ void HBQSyntaxHighlighter::highlightBlock( const QString &text )
/* Multi Line Comments - to ascertain if it is embedded in quotes */
int startIndex = 0;
int startSglLine = 0;
if( previousBlockState() != 1 )
{
startIndex = commentStartExpression.indexIn( text );
startSglLine = commentSingleLine.indexIn( text );
}
/* Quoted text */
@@ -247,18 +249,24 @@ void HBQSyntaxHighlighter::highlightBlock( const QString &text )
{
startIndex = -1;
}
if( startSglLine > index && startSglLine < index + length )
{
startSglLine = -1;
}
index = patternQuotation.indexIn( text, index + length );
}
/* Single Line Comments */
index = commentSingleLine.indexIn( text );
while( index >= 0 )
if( startSglLine >= 0 )
{
length = commentSingleLine.matchedLength();
setFormat( index, length, singleLineCommentFormat );
index = commentSingleLine.indexIn( text, index + length );
index = commentSingleLine.indexIn( text );
while( index >= 0 )
{
length = commentSingleLine.matchedLength();
setFormat( index, length, singleLineCommentFormat );
index = commentSingleLine.indexIn( text, index + length );
}
}
/* Multi Line Comments - continued */
setCurrentBlockState( 0 );