Formatting? was: Re: [squeak-dev] The Trunk: ToolBuilder-Morphic-cmm.164.mcz

Chris Muller asqueaker at gmail.com
Tue May 31 21:58:09 UTC 2016


By "everywhere" I assume you mean the ones just inside my brackets?
When block arguments are written without a space between the colon and
variable name, like this:

   coll do: [:each|each do something]

then I can't simply double-click the "each" declaration and then use
Cmd+g to find further occurrences, because double-clicking it also
selects the colon.

So, I could write:

    coll do: [: each|each do something]

but it looks strange to me.

But also for easier expression editing.  With no space, it is harder
to select the inner expression via double clicking just inside the
opening bracket; because a space there affords the user more width to
hit the expression than the narrow colon.

This effect can be verified on a computer with touch pad with
**separate buttons** (e.g., able to double-click without moving the
mouse even one pixel).  1) put a space there, 2) place mouse about
halfway into width of the space.  3) Without touching touch pad,
double-click to ensure expression is selected.  4) Now single-click to
deselect expression.  5) Now press [Delete] to delete the space.  6)
Without touching touch pad, again double-click in the exact same spot.
The colon is selected instead of the expression.

On Tue, May 31, 2016 at 4:42 PM, Tobias Pape <Das.Linux at gmx.de> wrote:
>
> On 31.05.2016, at 21:26, commits at source.squeak.org wrote:
>
>
>> Item was changed:
>>  ----- Method: PluggableTextMorphPlus>>drawBalloonTextOn: (in category 'drawing') -----
>> + drawBalloonTextOn: aCanvas
>> - drawBalloonTextOn: aCanvas
>>       "Show balloon text in the text morph if it has no contents."
>> +     textMorph contents ifNotEmpty: [ ^ self ].
>> +     ([ self balloonText ]
>> +             on: Error
>> +             do: [ : err | 'error in balloonText' ]) ifNotNil:
>> +             [ : text | aCanvas
>> -
>> -     textMorph contents ifNotEmpty: [^ self].
>> -
>> -     self balloonText ifNotNil: [:text |
>> -             aCanvas
>>                       drawString: text
>> +                     in: (self innerBounds insetBy: (5 @ 2 corner: 0 @ 0))
>> +                     font: textMorph textStyle defaultFont "I want italic here"
>> +                     color: (Color gray: 0.7) ]!
>> -                     in: (self innerBounds insetBy: (5 at 2 corner: 0 at 0))
>> -                     font: textMorph textStyle defaultFont
>> -                     color: (Color gray: 0.7)].!
>
> Just curious, why are you adding spaces everywhere?
> :)
> Best regards
>         -toibas


More information about the Squeak-dev mailing list