Issue 5404 in pharo: TextEditor correctFrom:to:with: is too clever

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

Issue 5404 in pharo: TextEditor correctFrom:to:with: is too clever

pharo
Status: Accepted
Owner: [hidden email]
Labels: Type-Cleanup Milestone-1.4

New issue 5404 by [hidden email]: TextEditor correctFrom:to:with: is  
too clever
http://code.google.com/p/pharo/issues/detail?id=5404

Look at the definition and tell me why a special handling of aString  
= '#insert period' would be ever required???

That's way too clever, and AFAICT unused.

  TextEditor>>correctFrom: start to: stop with: aString
        "Make a correction in the model that the user has authorised from  
somewhere else in the system (such as from the compilier).
        The user's selection is not changed, only corrected."
        | wasShowing userSelection delta loc |
        aString = '#insert period' ifTrue:
                [loc := start.
                [(loc := loc-1)>0 and: [(self string at: loc) isSeparator]]
                        whileTrue: [loc := loc-1].
                ^ self correctFrom: loc+1 to: loc with: '.'].
        userSelection := self selectionInterval.
        self selectInvisiblyFrom: start to: stop.
        self replaceSelectionWith: aString asText.
        delta := aString size - (stop - start + 1).
        self selectInvisiblyFrom:
                userSelection first + (userSelection first > start ifFalse: [ 0 ] ifTrue:  
[ delta ])
                to: userSelection last + (userSelection last > start ifFalse: [ 0 ]  
ifTrue: [ delta ]).




_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 5404 in pharo: TextEditor correctFrom:to:with: is too clever

pharo
Updates:
        Status: FixToInclude

Comment #1 on issue 5404 by [hidden email]: TextEditor  
correctFrom:to:with: is too clever
http://code.google.com/p/pharo/issues/detail?id=5404

ok we will remove

aString = '#insert period' ifTrue:
                [loc := start.
                [(loc := loc-1)>0 and: [(self string at: loc) isSeparator]]
                        whileTrue: [loc := loc-1].


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 5404 in pharo: TextEditor correctFrom:to:with: is too clever

pharo
Updates:
        Status: Integrated

Comment #2 on issue 5404 by [hidden email]: TextEditor  
correctFrom:to:with: is too clever
http://code.google.com/p/pharo/issues/detail?id=5404

in 14364


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker