<div id="__MailbirdStyleContent" style="font-size: 10pt;font-family: Arial;color: #000000;text-align: left" dir="ltr">
Here is an example:<div><br></div><div><img id="094e9db5-e2c3-4e2c-8d06-a0ed5ffbeee6" src="cid:dac8b637-da82-42cc-ba5a-7bfa5cd37e70" width="532" height="353"></img><br></div><div><br></div><div>Best,</div><div>Marcel</div><div class="mb_sig"></div>
<blockquote class="history_container" type="cite" style="border-left-style: solid;border-width: 1px;margin-top: 20px;margin-left: 0px;padding-left: 10px;min-width: 500px">
<p style="color: #AAAAAA; margin-top: 10px;">Am 13.01.2021 14:33:04 schrieb commits@source.squeak.org <commits@source.squeak.org>:</p><div style="font-family:Arial,Helvetica,sans-serif">Marcel Taeumel uploaded a new version of HelpSystem-Core to project The Trunk:<br>http://source.squeak.org/trunk/HelpSystem-Core-mt.134.mcz<br><br>==================== Summary ====================<br><br>Name: HelpSystem-Core-mt.134<br>Author: mt<br>Time: 13 January 2021, 2:32:57.075665 pm<br>UUID: 3680a1e7-e6e0-4144-a673-66b470bd5235<br>Ancestors: HelpSystem-Core-mt.133<br><br>In a help browser's search results, fixes the issue with title-only matches not showing up. Also show the path to the matched topic.<br><br>=============== Diff against HelpSystem-Core-mt.133 ===============<br><br>Item was changed:<br> ----- Method: SearchTopic>>find:in:results: (in category 'searching') -----<br> find: term in: path results: results<br> <br>+ | resultTemplate topic contents index | <br>- | resultTemplate c topic | <br> topic := path last.<br>+ resultTemplate := Array new: 6.<br>+ resultTemplate at: 1 put: path.<br>+ <br>+ contents := topic title asString.<br>+ (index := contents findString: term startingAt: 1 caseSensitive: false) > 0 ifTrue: [<br>+ resultTemplate at: 2 put: (index to: index + term size) ].<br>+ <br>+ contents := topic contents asString withSqueakLineEndings.<br>+ (index := contents findString: term startingAt: 1 caseSensitive: false) > 0 ifTrue: [<br>+ | leadingContext trailingContext i |<br>+ leadingContext := 0.<br>+ trailingContext := 0.<br>+ i := index.<br>+ [i notNil] whileTrue: [<br>+ (leadingContext = 2 or: [i = 1])<br>+ ifTrue: [<br>+ leadingContext := i = 1 ifTrue: [i] ifFalse: [i+1].<br>+ i := nil]<br>+ ifFalse: [<br>+ ((contents at: i) = Character cr) ifTrue: [<br>+ leadingContext := leadingContext + 1].<br>+ i := i - 1] ].<br>+ i := index + term size.<br>+ [i notNil] whileTrue: [<br>+ (trailingContext = 2 or: [i >= contents size])<br>+ ifTrue: [<br>+ trailingContext := i = contents size ifTrue: [i] ifFalse: [i-1].<br>+ i := nil]<br>+ ifFalse: [<br>+ ((contents at: i) = Character cr) ifTrue: [<br>+ trailingContext := trailingContext + 1].<br>+ i := i + 1] ].<br>- resultTemplate := Array new: 6. <br>- (topic title asString findString: term startingAt: 1 caseSensitive: false) in: [:index |<br>- index > 0 ifTrue: [resultTemplate at: 2 put: (index to: index + term size)]].<br> <br>+ resultTemplate<br>+ at: 3 put: (index - leadingContext + 1 to: index - leadingContext + term size);<br>+ at: 4 put: (contents copyFrom: leadingContext to: trailingContext);<br>+ at: 5 put: leadingContext;<br>+ at: 6 put: (index to: index + term size - 1) ].<br>- ((c := topic contents asString withSqueakLineEndings) findString: term startingAt: 1 caseSensitive: false) in: [:index |<br>- index > 0 ifTrue: [<br>- | leadingContext trailingContext i |<br>- leadingContext := 0.<br>- trailingContext := 0.<br>- i := index.<br>- [i notNil] whileTrue: [<br>- (leadingContext = 2 or: [i = 1])<br>- ifTrue: [<br>- leadingContext := i = 1 ifTrue: [i] ifFalse: [i+1].<br>- i := nil]<br>- ifFalse: [<br>- ((c at: i) = Character cr) ifTrue: [<br>- leadingContext := leadingContext + 1].<br>- i := i - 1] ].<br>- i := index + term size.<br>- [i notNil] whileTrue: [<br>- (trailingContext = 2 or: [i >= c size])<br>- ifTrue: [<br>- trailingContext := i = c size ifTrue: [i] ifFalse: [i-1].<br>- i := nil]<br>- ifFalse: [<br>- ((c at: i) = Character cr) ifTrue: [<br>- trailingContext := trailingContext + 1].<br>- i := i + 1] ].<br>- <br>- resultTemplate<br>- at: 1 put: path;<br>- at: 3 put: (index - leadingContext + 1 to: index - leadingContext + term size);<br>- at: 4 put: (c copyFrom: leadingContext to: trailingContext);<br>- at: 5 put: leadingContext;<br>- at: 6 put: (index to: index + term size - 1).<br>- <br>- self mutex critical: [ results add: resultTemplate ].<br>- self triggerUpdateContents.<br>- <br>- ] ].<br> <br>+ (resultTemplate second notNil "match in title" or: [resultTemplate third notNil "match in contents"]) ifTrue: [<br>+ self mutex critical: [ results add: resultTemplate ].<br>+ self triggerUpdateContents].<br>+ <br> topic isSearchable ifTrue: [<br> topic subtopics do: [:t | self find: term in: path, {t} results: results]].!<br><br>Item was changed:<br> ----- Method: SearchTopic>>printResultEntry: (in category 'private') -----<br> printResultEntry: entry<br> <br> | resultEntry topic |<br> resultEntry := '' asText.<br> topic := entry first last.<br> <br> entry second notNil<br> ifFalse: [resultEntry append: (<br> (topic title) asText<br> addAttribute: TextEmphasis bold)]<br> ifTrue: [resultEntry append: (<br> (topic title) asText<br> addAttribute: TextEmphasis bold;<br> addAttribute: (TextColor color: Color green muchDarker)<br> from: entry second first<br> to: entry second last)].<br> <br> resultEntry append: (' (open topic)' asText<br> addAttribute: (PluggableTextAttribute evalBlock: [<br> self changed: #searchResultSelected with: entry first.<br> self changed: #searchResultContentsSelected with: entry sixth])).<br> <br> resultEntry append: String cr.<br> <br>+ resultEntry append: (<br>+ ('> ', ((entry first allButLast collect: [:t | t title]) joinSeparatedBy: ' > ')) asText<br>+ addAttribute: (TextColor color: (Color gray: 0.7))).<br>+ <br>+ resultEntry append: String cr.<br>+ <br>+ entry fourth ifNil: [resultEntry append: '\\' withCRs] ifNotNil: [:contents |<br>- entry fourth in: [:contents |<br> | text |<br> text := contents asText.<br> text<br> addAttribute: (TextColor color: Color green muchDarker)<br> from: entry third first<br> to: entry third last;<br> addAttribute: TextEmphasis bold<br> from: entry third first<br> to: entry third last.<br> resultEntry<br> append: text withBlanksTrimmed;<br> append: '\\' withCRs.<br> <br> ].<br> <br> ^ resultEntry!<br><br><br></div></blockquote></div>