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

Thiede, Christoph Christoph.Thiede at student.hpi.uni-potsdam.de
Thu Sep 5 13:06:06 UTC 2019


Personally, I sometimes type-to-filter a menu for things like '...' or ' ' (space). Am I the only one who does this? :)


I still would consider something like Character>>#isControlCharacter useful. How about this?


Unicode class>>isControlCode: charCode
^ (self generalCategoryOf: charCode) <= Cs

Character>>isControlCharacter
^ self encodedCharSet isControlCode: self charCode

Versions for other char sets would have to be added.

Best,
Christoph
________________________________
Von: Squeak-dev <squeak-dev-bounces at lists.squeakfoundation.org> im Auftrag von commits at source.squeak.org <commits at source.squeak.org>
Gesendet: Donnerstag, 5. September 2019 14:36:59
An: squeak-dev at lists.squeakfoundation.org; packages at lists.squeakfoundation.org
Betreff: [squeak-dev] The Trunk: Morphic-mt.1514.mcz

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!


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20190905/b55c8ee5/attachment.html>


More information about the Squeak-dev mailing list