1549 "/]. |
1549 "/]. |
1550 "/self showCursor. |
1550 "/self showCursor. |
1551 "/^ self. |
1551 "/^ self. |
1552 |
1552 |
1553 access critical:[ |
1553 access critical:[ |
1554 |i i2 s crnlFollows| |
1554 |index controlCharIndex stringWithOutControl crnlFollows| |
1555 |
1555 |
1556 i := 1. |
1556 index := 1. |
1557 [i <= count] whileTrue:[ |
1557 [index <= count] whileTrue:[ |
1558 (state == 0) ifTrue:[ |
1558 (state == 0) ifTrue:[ |
1559 "/ in initial state. |
1559 "/ in initial state. |
1560 "/ quick scan forward for next control character ... |
1560 "/ quick scan forward for next control character ... |
1561 i2 := buffer indexOfControlCharacterStartingAt:i. |
1561 controlCharIndex := buffer indexOfControlCharacterStartingAt:index. |
1562 i2 > count ifTrue:[i2 := 0]. |
1562 controlCharIndex > count ifTrue:[controlCharIndex := 0]. |
1563 |
1563 |
1564 i2 == 0 ifTrue:[ |
1564 controlCharIndex == 0 ifTrue:[ |
1565 "/ no control characters - simply append all |
1565 "/ no control characters - simply append all |
1566 "/ to the outstanding lines ... |
1566 "/ to the outstanding lines ... |
1567 s := buffer copyFrom:i to:count. |
1567 stringWithOutControl := buffer copyFrom:index to:count. |
1568 i := count + 1. "/ leave loop. |
1568 index := count + 1. "/ leave loop. |
1569 crnlFollows := false. |
1569 crnlFollows := false. |
1570 ] ifFalse:[ |
1570 ] ifFalse:[ |
1571 i2 > i ifTrue:[ |
1571 controlCharIndex > index ifTrue:[ |
1572 s := buffer copyFrom:i to:i2-1. |
1572 stringWithOutControl := buffer copyFrom:index to:controlCharIndex-1. |
1573 i := i2. "/ proceed withcontrol character |
1573 index := controlCharIndex. "/ proceed withcontrol character |
1574 crnlFollows := false. |
1574 crnlFollows := false. |
1575 i < (count - 1) ifTrue:[ |
1575 index < (count - 1) ifTrue:[ |
1576 (buffer at:i) == Character return ifTrue:[ |
1576 (buffer at:index) == Character return ifTrue:[ |
1577 (buffer at:i+1) == Character nl ifTrue:[ |
1577 (buffer at:index+1) == Character nl ifTrue:[ |
1578 crnlFollows := true. |
1578 crnlFollows := true. |
1579 i := i + 2. |
1579 index := index + 2. |
1580 ] |
1580 ] |
1581 ] |
1581 ] |
1582 ]. |
1582 ]. |
1583 ] |
1583 ] |
1584 ]. |
1584 ]. |
1585 ]. |
1585 ]. |
1586 |
1586 |
1587 s notNil ifTrue:[ |
1587 stringWithOutControl notNil ifTrue:[ |
1588 currentEmphasis notNil ifTrue:[ |
1588 currentEmphasis notNil ifTrue:[ |
1589 s := s emphasizeAllWith:currentEmphasis |
1589 stringWithOutControl := stringWithOutControl emphasizeAllWith:currentEmphasis |
1590 ]. |
1590 ]. |
1591 |
1591 |
1592 outstandingLine size > 0 ifTrue:[ |
1592 outstandingLine size > 0 ifTrue:[ |
1593 outstandingLine := outstandingLine , s. |
1593 outstandingLine := outstandingLine , stringWithOutControl. |
1594 ] ifFalse:[ |
1594 ] ifFalse:[ |
1595 outstandingLine := s. |
1595 outstandingLine := stringWithOutControl. |
1596 ]. |
1596 ]. |
1597 crnlFollows ifTrue:[ |
1597 crnlFollows ifTrue:[ |
1598 outstandingLines isNil ifTrue:[ |
1598 outstandingLines isNil ifTrue:[ |
1599 outstandingLines := OrderedCollection with:outstandingLine |
1599 outstandingLines := OrderedCollection with:outstandingLine |
1600 ] ifFalse:[ |
1600 ] ifFalse:[ |
1601 outstandingLines add:outstandingLine. |
1601 outstandingLines add:outstandingLine. |
1602 ]. |
1602 ]. |
1603 outstandingLine := ''. |
1603 outstandingLine := ''. |
1604 ]. |
1604 ]. |
1605 s := nil. |
1605 stringWithOutControl := nil. |
1606 |
1606 |
1607 collecting ifTrue:[ |
1607 collecting ifTrue:[ |
1608 flushPending ifFalse:[ |
1608 flushPending ifFalse:[ |
1609 self installDelayedUpdate |
1609 self installDelayedUpdate |
1610 ] ifTrue:[ |
1610 ] ifTrue:[ |