Walkback in DSDN code

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Walkback in DSDN code

maddyfreccero
Not sure where to report this to - but finally decided to try DSDN (wow
- its very handy).

However I just entered a search for "automated build" and I get a
walkback in the following method:

highlightNextTargetIn: aUrlOrTextPresenter
        | aFindDetails |
        self canLocate ifFalse: [^self].
        aFindDetails := (FindDetails new)
                                pattern: DsdnSearch current searchFor;
                                isForwards: true;
                                isWholeWord: DsdnSearch current wholeWord;
                                isCaseSensitive: DsdnSearch current ignoreCase not;
                                isWrapAround: true;
                                yourself.
        (aUrlOrTextPresenter view)
                findNextWrapped: aFindDetails;
                lineScroll: (aUrlOrTextPresenter view lineFromPosition:
aUrlOrTextPresenter selectionRange first)

Basically - aUrlOrTextPresenter selectionRange first is a range (1 to:
0) - and so first raises an error.

A simple fix could be to  refactor this into a method and do something
like:?

presenterRange: aUrlOrTextPresenter
        | range |
        ^(range := aUrlOrTextPresenter selectionRange) isEmpty ifTrue: [1]
ifFalse: [range first]


Tim


Reply | Threaded
Open this post in threaded view
|

Re: Walkback in DSDN code

Janos Kazsoki
Reply | Threaded
Open this post in threaded view
|

Re: Walkback in DSDN code

Ian Bartholomew-21
Janos,

> this is a known issue. See earlier post in this group:

Thanks for the reminder.  I've (finally) got round to updating the
download at http://www.smalltalk.vispa.com/files/dsdn.zip

--
Ian

Use the Reply-To address to contact me (limited validity).
Mail sent to the From address is ignored.