From 25f162eaa9e56f6b051296e6f3d800c857a963c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phaneDucasse?= Date: Tue, 31 Aug 2021 09:26:03 +0200 Subject: [PATCH] improving the search --- .../StHelpBrowserPresenter.class.st | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/NewTools-DocumentationReader/StHelpBrowserPresenter.class.st b/src/NewTools-DocumentationReader/StHelpBrowserPresenter.class.st index 00924b6..182819c 100644 --- a/src/NewTools-DocumentationReader/StHelpBrowserPresenter.class.st +++ b/src/NewTools-DocumentationReader/StHelpBrowserPresenter.class.st @@ -178,12 +178,16 @@ StHelpBrowserPresenter class >> openOnHelpFolder: aFileReference [ yourself ] -{ #category : #'as yet unclassified' } +{ #category : #'basic search' } StHelpBrowserPresenter class >> search: aTopicName in: topicCollection with: aCollection [ + + | lookedup | + lookedup := aTopicName asLowercase. + topicCollection ifNotEmpty: [ topicCollection doWithIndex: [ :topic :i | aCollection add: i. - topic title = aTopicName + ((topic title asLowercase splitOn: Character space) anySatisfy: [ :each | lookedup match: each ]) ifTrue: [ ^ aCollection ] ifFalse: [ (self search: aTopicName in: topic subtopics with: aCollection) isCollection ifTrue: [ ^ aCollection]].