--- a/EditTextView.st Thu Oct 07 13:22:37 1999 +0200
+++ b/EditTextView.st Thu Oct 07 13:23:14 1999 +0200
@@ -2452,8 +2452,8 @@
self checkModificationsAllowed ifFalse:[ ^ self].
aCharacter == (Character cr) ifTrue:[
- self splitLine:lineNr before:colNr.
- ^ self
+ self splitLine:lineNr before:colNr.
+ ^ self
].
drawCharacterOnly := false.
@@ -2462,78 +2462,80 @@
lineSize := line size.
st80Mode ~~ true ifTrue:[
- (trimBlankLines
- and:[colNr > lineSize
- and:[aCharacter == Character space]]) ifTrue:[
- ^ self
- ]
+ (trimBlankLines
+ and:[colNr > lineSize
+ and:[aCharacter == Character space]]) ifTrue:[
+ ^ self
+ ]
].
(lineSize == 0) ifTrue:[
- newLine := aCharacter asString species new:colNr.
- drawCharacterOnly := true
+ newLine := aCharacter asString species new:colNr.
+ drawCharacterOnly := true
] ifFalse: [
- (colNr > lineSize) ifTrue: [
- colNr == (lineSize +1) ifTrue:[
- attribute := line emphasisAt:lineSize
- ].
- newLine := line species new:colNr.
- newLine replaceFrom:1 to:lineSize
- with:line startingAt:1.
- drawCharacterOnly := true
- ] ifFalse: [
- attribute := line emphasisAt:colNr.
- newLine := line species new:(lineSize + 1).
-
- newLine replaceFrom:1 to:(colNr - 1)
- with:line startingAt:1.
- newLine replaceFrom:(colNr + 1) to:(lineSize + 1)
- with:line startingAt:colNr
- ]
+ (colNr > lineSize) ifTrue: [
+ colNr == (lineSize +1) ifTrue:[
+ attribute := line emphasisAt:lineSize
+ ].
+ newLine := line species new:colNr.
+ newLine replaceFrom:1 to:lineSize
+ with:line startingAt:1.
+ drawCharacterOnly := true
+ ] ifFalse: [
+ attribute := line emphasisAt:colNr.
+ newLine := line species new:(lineSize + 1).
+
+ newLine replaceFrom:1 to:(colNr - 1)
+ with:line startingAt:1.
+ newLine replaceFrom:(colNr + 1) to:(lineSize + 1)
+ with:line startingAt:colNr
+ ]
].
newLine at:colNr put:aCharacter.
attribute notNil ifTrue:[
- newLine emphasisAt:colNr put:attribute
+ newLine emphasisAt:colNr put:attribute
].
aCharacter == (Character tab) ifTrue:[
- newLine := self withTabsExpanded:newLine.
- drawCharacterOnly := false
+ newLine := self withTabsExpanded:newLine.
+ drawCharacterOnly := false
].
list at:lineNr put:newLine.
widthOfWidestLine notNil ifTrue:[
- widthOfWidestLine := widthOfWidestLine max:(self widthOfLineString:line).
+ widthOfWidestLine := widthOfWidestLine max:(self widthOfLineString:line).
].
self textChanged.
shown ifTrue:[
- "/ care for italic text - in this case, we must also
- "/ redraw the character before the insertion in order
- "/ to fix the slanted piece of the character.
- "/ (but we must clip, to avoid destoying the character before)
- (newLine notNil and:[newLine isText]) ifTrue:[
- colNr > 1 ifTrue:[
- oldClip := self clippingRectangleOrNil.
- x := (self xOfCol:colNr inVisibleLine:cursorVisibleLine) - leftOffset.
- y := self yOfVisibleLine:cursorVisibleLine.
- drawCharacterOnly ifTrue:[
- self clippingRectangle:(x@y extent:((font width * 2) @ fontHeight)).
- self redrawLine:lineNr from:colNr-1 to:colNr
- ] ifFalse:[
- self clippingRectangle:(x@y extent:((width - x) @ fontHeight)).
- self redrawLine:lineNr from:colNr-1
- ].
- self clippingRectangle:oldClip.
- ^ self.
- ].
- ].
- drawCharacterOnly ifTrue:[
- self redrawLine:lineNr col:colNr
- ] ifFalse:[
- self redrawLine:lineNr from:colNr
- ]
+ "/ care for italic text - in this case, we must also
+ "/ redraw the character before the insertion in order
+ "/ to fix the slanted piece of the character.
+ "/ (but we must clip, to avoid destoying the character before)
+ (newLine notNil and:[newLine isText]) ifTrue:[
+ colNr > 1 ifTrue:[
+ cursorVisibleLine notNil ifTrue:[
+ oldClip := self clippingRectangleOrNil.
+ x := (self xOfCol:colNr inVisibleLine:cursorVisibleLine) - leftOffset.
+ y := self yOfVisibleLine:cursorVisibleLine.
+ drawCharacterOnly ifTrue:[
+ self clippingRectangle:(x@y extent:((font width * 2) @ fontHeight)).
+ self redrawLine:lineNr from:colNr-1 to:colNr
+ ] ifFalse:[
+ self clippingRectangle:(x@y extent:((width - x) @ fontHeight)).
+ self redrawLine:lineNr from:colNr-1
+ ].
+ self clippingRectangle:oldClip.
+ ].
+ ^ self.
+ ].
+ ].
+ drawCharacterOnly ifTrue:[
+ self redrawLine:lineNr col:colNr
+ ] ifFalse:[
+ self redrawLine:lineNr from:colNr
+ ]
]
"Modified: / 20.6.1998 / 18:19:22 / cg"
@@ -4706,5 +4708,5 @@
!EditTextView class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libwidg/EditTextView.st,v 1.217 1999-10-04 10:44:59 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libwidg/EditTextView.st,v 1.218 1999-10-07 11:23:14 cg Exp $'
! !