[Newbies] Display artifacts in comments/desc.

Edgar J. De Cleene edgardec2001 at yahoo.com.ar
Tue May 8 20:12:17 UTC 2007




El 5/7/07 2:23 PM, "Bert Freudenberg" <bert at freudenbergs.de> escribió:

> 
> On May 7, 2007, at 6:14 , subbukk wrote:
> 
>> On Monday 30 April 2007 7:12 pm, Edgar J. De Cleene wrote:
>>> El 4/30/07 10:22 AM, "subbukk" <subbukk at gmail.com> escribió:
>>>> Hi,
>>>> 
>>>> I see some artifacts (like []) displayed in comments and
>>>> descriptions in
>>>> Squeak (3.7-7 vm on Linux, 3.8 image and SqueakV39.sources). I
>>>> suspect
>>>> the '\r' line terminator in the *.sources file could be causing it.
>>>> 
>>>> Is this a bug?
>>>> 
>>>> TIA .. Subbu
>>> 
>>> I think what could be eliminated if you do Smalltalk
>>> removeAllLineFeeds.
>>> 
>>> In Mac , I found this often.
>> 
>> Squeak3.9 handling of CRLF sequences in sources file is defective.
> 
> I do not think it is.
> 
>> Squeak3.8
>> image correctly strips of LF in CRLF while reading in text from
>> SqueakV3.sources file. For instance, editStartPage method in
>> Scamper uses
>> CRLF in SqueakV3.sources file but its Text in codepane strips out LF.
> 
> I do not think this is the case.
> 
> It is just that images up to 3.8 did not *display* LF chars embedded
> in a String because the corresponding glyph in the fonts was blank.
> This has been fixed, we should not have invisible characters anymore
> (which are very annoying), and this just exposes the problem of LFs
> in some method sources. They have been there all along, they just
> were not visible.
> 
> Reading in code must not strip LFs unless specifically told to,
> because it is perfectly valid to embed a LF in a String in source
> code if you want to.
> 
> - Bert -
> 
> 

Just working with Mac and copyng data of Mantis I cook this quick dirty
solution what works on Mac.
I select the text with artifacts (in my case the preamble of a new .cs) and
paste again in PluggableTextMorph

Edgar

> 

-------------- next part --------------
'From Squeak3.10alpha of 30 March 2007 [latest update: #7094] on 8 May 2007 at 5:05:20 pm'!

!Clipboard methodsFor: 'accessing' stamp: 'edc 5/8/2007 17:04'!
clipboardText
	"Return the text currently in the clipboard. If the system clipboard is empty, or if it differs from the Smalltalk clipboard text, use the Smalltalk clipboard. This is done since (a) the Mac clipboard gives up on very large chunks of text and (b) since not all platforms support the notion of a clipboard."

	| string decodedString |
	string := self primitiveClipboardText withSqueakLineEndings.
	(string isEmpty
			or: [string = contents asString])
		ifTrue: [^ contents].
	decodedString := self interpreter fromSystemClipboard: string.
	^ decodedString = contents asString 
		ifTrue: [contents]
		ifFalse: [decodedString asText].
! !


More information about the Squeak-dev mailing list