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=5404Look 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