The Trunk: Morphic-cmm.755.mcz

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

The Trunk: Morphic-cmm.755.mcz

commits-2
Chris Muller uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-cmm.755.mcz

==================== Summary ====================

Name: Morphic-cmm.755
Author: cmm
Time: 31 January 2015, 2:47:31.992 pm
UUID: 46064dd7-97b4-48a7-856a-968440827256
Ancestors: Morphic-mt.754

Let the "Compare to Clipboard" function compare just the selected text to the clipboard text.

=============== Diff against Morphic-mt.754 ===============

Item was changed:
  ----- Method: TextEditor>>compareToClipboard (in category 'menu messages') -----
  compareToClipboard
  "Check to see if whether the receiver's text is the same as the text currently on the clipboard, and inform the user."
  | s1 s2 |
  s1 := self clipboardText string.
+ s2 := self selection string.
- s2 := paragraph text string.
  s1 = s2 ifTrue: [^ self inform: 'Exact match'].
 
  (StringHolder new textContents:
  (TextDiffBuilder buildDisplayPatchFrom: s1 to: s2))
  openLabel: 'Comparison to Clipboard Text'!


Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Morphic-cmm.755.mcz

marcel.taeumel (old)
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
Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Morphic-cmm.755.mcz

Levente Uzonyi-2
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.
>
>

Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Morphic-cmm.755.mcz

marcel.taeumel (old)
+1

Marcel :)