[squeak-dev] The Trunk: Morphic-mt.1514.mcz

commits at source.squeak.org commits at source.squeak.org
Thu Sep 5 12:36:59 UTC 2019


Marcel Taeumel uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-mt.1514.mcz

==================== Summary ====================

Name: Morphic-mt.1514
Author: mt
Time: 5 September 2019, 2:36:47.777837 pm
UUID: 49f63b40-72ce-c447-9fb0-9400ea43fab2
Ancestors: Morphic-mt.1513, Morphic-ct.1501

Merges Morphic-ct.1500. and 1501.

Can't we just filter for #isAlphaNumeric? Do we need parentheses etc.? Would be more readable than  ">= 32". I also do not think that #caseOf: helps much in terms of readability. ;-)

=============== Diff against Morphic-mt.1513 ===============

Item was changed:
  ----- Method: MenuMorph>>handleFiltering: (in category 'keystroke helpers') -----
  handleFiltering: evt
  
  	| matchString |
  	matchString := self valueOfProperty: #matchString ifAbsentPut: [ String new ].
+ 	matchString := true
+ 		caseOf: {
+ 			[ evt keyCharacter = Character backspace ] ->
+ 				[ matchString isEmpty 
+ 					ifTrue: [ matchString ] 
+ 					ifFalse: [ matchString allButLast ] ].
+ 			[ evt keyValue >= 32 ] ->
+ 				[ matchString , evt keyCharacter ] }
+ 		otherwise: [ matchString ].
- 	matchString := evt keyValue = 8 " Character backspace asciiValue "
- 		ifTrue: [
- 			matchString isEmpty 
- 				ifTrue: [ matchString ] 
- 				ifFalse: [ matchString allButLast ] ]
- 		ifFalse: [
- 			matchString copyWith: evt keyCharacter ].
  	self setProperty: #matchString toValue: matchString.
  	self displayFiltered: evt!



More information about the Squeak-dev mailing list