aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden
diff options
context:
space:
mode:
authorMcCabe Maxsted2009-01-25 04:46:41 -0700
committerMcCabe Maxsted2009-01-25 04:46:41 -0700
commita23ca9e4658214bdbbd990b1ca7a3c0cd034a508 (patch)
treef7fd234f2679b08f47d840eea260572bb1ef1351 /linden
parentFixed 'open in external browser' button (diff)
parentFixed single line comment highlighting (diff)
downloadmeta-impy-a23ca9e4658214bdbbd990b1ca7a3c0cd034a508.zip
meta-impy-a23ca9e4658214bdbbd990b1ca7a3c0cd034a508.tar.gz
meta-impy-a23ca9e4658214bdbbd990b1ca7a3c0cd034a508.tar.bz2
meta-impy-a23ca9e4658214bdbbd990b1ca7a3c0cd034a508.tar.xz
Merge branch 'scriptcommentfix' into 1.1.0-RC1
Diffstat (limited to 'linden')
-rw-r--r--linden/indra/llui/llkeywords.cpp40
1 files changed, 35 insertions, 5 deletions
diff --git a/linden/indra/llui/llkeywords.cpp b/linden/indra/llui/llkeywords.cpp
index 8cd33a2..cd58d70 100644
--- a/linden/indra/llui/llkeywords.cpp
+++ b/linden/indra/llui/llkeywords.cpp
@@ -412,6 +412,22 @@ void LLKeywords::findSegments(std::vector<LLTextSegment *>* seg_list, const LLWS
412 break; 412 break;
413 } 413 }
414 } 414 }
415 else if (cur_delimiter->isHead(cur))
416 {
417 // Is there was an odd number of backslashes, then this delimiter
418 // does not end the sequence.
419 if (num_backslashes % 2 == 1)
420 {
421 between_delimiters++;
422 cur++;
423 }
424 else
425 {
426 // This is an end delimiter.
427 break;
428 }
429 }
430
415 } 431 }
416 else 432 else
417 { 433 {
@@ -423,9 +439,25 @@ void LLKeywords::findSegments(std::vector<LLTextSegment *>* seg_list, const LLWS
423 if( *cur ) 439 if( *cur )
424 { 440 {
425 cur += cur_delimiter->getLength(); 441 cur += cur_delimiter->getLength();
426 seg_end = seg_start + between_delimiters 442 if (cur_delimiter->getType() == LLKeywordToken::TWO_SIDED_DELIMITER)
427 + cur_delimiter->getLength() 443 {
428 + cur_delimiter->getLength2(); 444 seg_end = seg_start + between_delimiters + 2 * cur_delimiter->getLength();
445 }
446 else if (cur_delimiter->getType() == LLKeywordToken::ONE_SIDED_DELIMITER)
447 {
448 while( *cur && ('\n' != *cur) )
449 {
450 between_delimiters++;
451 cur++;
452 }
453 seg_end = seg_start + between_delimiters + 2 + cur_delimiter->getLength();
454 }
455 else
456 {
457 seg_end = seg_start + between_delimiters
458 + cur_delimiter->getLength()
459 + cur_delimiter->getLength2();
460 }
429 } 461 }
430 else 462 else
431 { 463 {
@@ -435,7 +467,6 @@ void LLKeywords::findSegments(std::vector<LLTextSegment *>* seg_list, const LLWS
435 } 467 }
436 else 468 else
437 { 469 {
438 llassert( cur_delimiter->getType() == LLKeywordToken::ONE_SIDED_DELIMITER );
439 // Left side is the delimiter. Right side is eol or eof. 470 // Left side is the delimiter. Right side is eol or eof.
440 while( *cur && ('\n' != *cur) ) 471 while( *cur && ('\n' != *cur) )
441 { 472 {
@@ -445,7 +476,6 @@ void LLKeywords::findSegments(std::vector<LLTextSegment *>* seg_list, const LLWS
445 seg_end = seg_start + between_delimiters + cur_delimiter->getLength(); 476 seg_end = seg_start + between_delimiters + cur_delimiter->getLength();
446 } 477 }
447 478
448
449 LLTextSegment* text_segment = new LLTextSegment( cur_delimiter->getColor(), seg_start, seg_end ); 479 LLTextSegment* text_segment = new LLTextSegment( cur_delimiter->getColor(), seg_start, seg_end );
450 text_segment->setToken( cur_delimiter ); 480 text_segment->setToken( cur_delimiter );
451 insertSegment( seg_list, text_segment, text_len, defaultColor); 481 insertSegment( seg_list, text_segment, text_len, defaultColor);