Browser bug/artifact

Gerardo Richarte gr at fuzzy.uba.ar
Sat Apr 11 09:11:10 UTC 1998


Hola Ian Bicking!
> 
> The browser hasn't always been accepting my modified code when I do a
> command-S (the pane just flashes, as though I haven't made any
> changes).  But, if I delete the first letter and retype it, then it
> will work as expected.  The problem seems to get worse as the image
> gets older.  Any ideas of what's going on?
> 

	The problem is in ParagraphEditor>>dispatchOnCharacter:with:, I have
already posted a BugFix for version 1.23, but the bug was back in v1.3x. Here
is the (updated) Fix:

--------------------------------------------------
'From Squeak 1.3 of Jan 16, 1998 on 10 April 1998 at 1:06:11 am'!

!ParagraphEditor methodsFor: 'typing support' stamp: 'r++ 3/31/98 21:46'!
dispatchOnCharacter: char with: typeAheadStream
	"Carry out the action associated with this character, if any.
	Type-ahead is passed so some routines can flush or use it."

	char = Character enter
		ifTrue: [^ self dispatchOnEnterWith: typeAheadStream].

	"enter, backspace, and escape keys (ascii 3, 8, and 27) are command keys"
	(sensor commandKeyPressed or: [self class specialShiftCmdKeys includes: char asciiValue]) ifTrue:
		[self closeTypeIn.	"r++ 3/31/98 21:46.	Bug Fix"
		^ sensor leftShiftDown
			ifTrue:
				[self perform: (ShiftCmdActions at: char asciiValue + 1) with: typeAheadStream]
			ifFalse:
				[self perform: (CmdActions at: char asciiValue + 1) with: typeAheadStream]].

	"the control key can be used to invoke shift-cmd shortcuts"
	sensor controlKeyPressed ifTrue:
		[^ self perform: (ShiftCmdActions at: char asciiValue + 1) with: typeAheadStream].
	^ self perform: #normalCharacter: with: typeAheadStream! !

-----------------------------------------

	I also have a fix that I've done to ParagraphEditor>>crWithIndent (or
something like that) but I can't remember what was the problem... Maybe
something regarding doing it on the las line of a code pane... I don't know,
I'm not sure...

-----------------------------------------


'From Squeak 1.3 of Jan 16, 1998 on 10 April 1998 at 1:39:40 am'!

!ParagraphEditor methodsFor: 'typing/selecting keys' stamp: 'r++ 3/31/98 21:46'!
crWithIndent: characterStream 
	"Replace the current text selection with CR followed by as many tabs
	as on the current line (+/- bracket count) -- initiated by Shift-Return."
	| char s i tabCount |
	sensor keyboard.		"flush character"
	s _ paragraph string.
	i _ stopBlock stringIndex.
	tabCount _ 0.
	[(i _ i-1) > 0 and: [(char _ s at: i) ~= Character cr]]
		whileTrue:  "Count tabs and brackets (but not a leading bracket)"
		[(char = Character tab and: [(i = s size) or: [(s at: i+1) ~= $[]]) ifTrue: [tabCount _ tabCount + 1]. "r++ 3/31/98 21:46.	Bug Fix"
		char = $[ ifTrue: [tabCount _ tabCount + 1].
		char = $] ifTrue: [tabCount _ tabCount - 1]].
	characterStream crtab: tabCount.  "Now inject CR with tabCount tabs"
	^ false! !

------------------------------------------

	This should fix your problem...

	Fixing Bye!
	Richie++





More information about the Squeak-dev mailing list