[BUG] [FIX] Browser loses method text if new first method has spelling fault

Tim Rowledge rowledge at interval.com
Fri Jun 25 02:26:49 UTC 1999


IF you attempt to save a method that has an unknown symbol (my usual
spelling mistake!) AND you have the -all- message category selected then
the method text is whipped out from under you.

It appears to be a problem in Browser>messageCategoryListIndex:, or at
least the usage of it within Browser>contents:notifying:. There is an
attempt to correct for the 'wrong' category being selected and the code
ends up clearing the code view. There is also a trivial bug in
Browser>selectUnclassifiedCategory, where 0 is hardcoded as the index of
the 'no messages' category; it seems more reasonable for it to be 1, since
it follows 'all' which is an imaginary entry.

As for a fix, I imagine changing the contents:notifying: code to send some
other message that changes the category that is used to compile under but
does not affect the browser display should work. Since both of the methods
(#selectOriginalCategoryForCurrentMethod & #selectUnclassifiedCategory) are
only used in contents:notifying: this ought to be reasonably safe.

It seems to be ok if we change #selectMessageCategoryNamed: to avoid the
display updating and change #selectUnclassifiedCategory to use it with the
name of the category rather than the index.

Possible fix changeset enclosed.

tim

-- 
Useful random insult:- Overdue for reincarnation.
Tim Rowledge:  rowledge at interval.com (w)  +1 (650) 842-6110 (w)
 tim at sumeru.stanford.edu (h)  <http://sumeru.stanford.edu/tim>

'From Squeak 2.4b of April 23, 1999 on 24 June 1999 at 7:25:51 pm'!

!Browser methodsFor: 'message category list' stamp: 'TPR 6/24/1999 19:20'!
selectMessageCategoryNamed: aSymbol 
	"Given aSymbol, select the category with that name.  Do nothing if 
	aSymbol doesn't exist."
	(self messageCategoryList includes: aSymbol)
		ifFalse: [^ self].
	messageCategoryListIndex _ (self messageCategoryList indexOf: aSymbol)! !

!Browser methodsFor: 'message category list' stamp: 'TPR 6/24/1999 19:19'!
selectUnclassifiedCategory
	"Select the unclassified category."

	self selectMessageCategoryNamed: 'as yet unclassified' asSymbol! !





More information about the Squeak-dev mailing list