[squeak-dev] Re: The Trunk: Morphic-cmm.755.mcz

Levente Uzonyi leves at elte.hu
Sun Feb 1 11:53:03 UTC 2015


How about something like this?

compareToClipboard
 	"Check to see if the receiver's selection or text - in case 
there's no selection - is the same as the text currently on the clipboard, 
and inform the user."

 	| s1 s2 |
 	s1 := self clipboardText string.
 	s2 := self selection string ifEmpty: [  paragraph text string ].
 	s1 = s2 ifTrue: [^ self inform: 'Exact match'].

 	(StringHolder new textContents:
 		(TextDiffBuilder buildDisplayPatchFrom: s1 to: s2))
 		openLabel: 'Comparison to Clipboard Text'


Levente

On Sun, 1 Feb 2015, Marcel Taeumel wrote:

> Hi. :)
>
> You might then want to change the method's description, too. The "receiver's
> text" is not just the selection but the whole text the editor handles.
>
> Maybe we need a #compareSelectionToClipboard for this and not change the
> meaning of #compareToClipboard?
>
> Best,
> Marcel
>
>
>
> --
> View this message in context: http://forum.world.st/The-Trunk-Morphic-cmm-755-mcz-tp4802968p4803010.html
> Sent from the Squeak - Dev mailing list archive at Nabble.com.
>
>


More information about the Squeak-dev mailing list