#FEATURE by cg
class: Tools::NewSystemBrowser class
changed: #askForClassToSearch:single:msgTail:resources:filter:forBrowser:thenDo:
better sorting of matchng class names
--- a/Tools__NewSystemBrowser.st Wed Aug 09 10:39:38 2017 +0200
+++ b/Tools__NewSystemBrowser.st Wed Aug 09 23:57:34 2017 +0200
@@ -18773,7 +18773,8 @@
updateClassAndNameList value.
updateList := [
- |nameToSearch list namesStarting namesIncluding lcName nameList classList isMatch labelText|
+ |nameToSearch list namesStarting namesEnding namesIncluding restList
+ lcName nameList classList isMatch labelText|
(nameToSearch := classNameHolder value withoutSeparators) isEmpty ifTrue:[
labelText := 'Recently visited:'.
@@ -18866,7 +18867,14 @@
] thenCollect:[:idx | nameList at:idx].
].
namesStarting := namesIncluding select:[:nm | nm asLowercase startsWith:lcName].
- list := namesStarting , {nil} , (namesIncluding \ namesStarting).
+ restList := (namesIncluding \ namesStarting).
+ namesEnding := restList select:[:nm | nm asLowercase endsWith:lcName].
+ restList := (restList \ namesEnding).
+ (namesStarting notEmpty or:[namesEnding notEmpty]) ifTrue:[
+ list := namesStarting,namesEnding,{nil},restList.
+ ] ifFalse:[
+ list := restList.
+ ].
]
]
].
@@ -18952,7 +18960,7 @@
^ className
"Modified: / 04-09-2013 / 17:48:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
- "Modified: / 27-07-2017 / 12:43:57 / cg"
+ "Modified: / 09-08-2017 / 23:56:38 / cg"
!
enterBoxTitle:title okText:okText label:label