Chris Muller uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-cmm.756.mcz
==================== Summary ====================
Name: Morphic-cmm.756
Author: cmm
Time: 1 February 2015, 1:06:11.045 pm
UUID: c1553853-472d-45ca-a182-c07497c6f7a9
Ancestors: Morphic-cmm.755
- Present the comparison to clipboard text from the context of paste-modification, since that is what the user is determining whether to do with the clipboard contents.
- Make the same change to ParagraphEditor, for consistency.
=============== Diff against Morphic-cmm.755 ===============
Item was changed:
----- Method: TextEditor>>compareToClipboard (in category 'menu messages') -----
compareToClipboard
+ "If any text is selected, present the modifications that would be made to it if the clipboard contents were pasted over it. If no text is selected, present the differences betwen the entire pane's contents and the clipboard text."
+ | subjectText proposedText |
+ subjectText := self selection string ifEmpty: [ paragraph text string ].
+ proposedText := self clipboardText string.
+ subjectText = proposedText ifTrue: [^ self inform: 'Exact match'].
+ (StringHolder new
+ textContents:
+ (TextDiffBuilder
+ buildDisplayPatchFrom: subjectText
+ to: proposedText)) openLabel: 'Differences with Clipboard Text'!
- "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.
- s1 = s2 ifTrue: [^ self inform: 'Exact match'].
-
- (StringHolder new textContents:
- (TextDiffBuilder buildDisplayPatchFrom: s1 to: s2))
- openLabel: 'Comparison to Clipboard Text'!
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.