syntaxHighlightingAsYouTypeLeftArrowAssignment

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

syntaxHighlightingAsYouTypeLeftArrowAssignment

stes
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256


Hi,

Platform:  squeak 4.19.5 with Squeak 4.6 or squeak 5.x with Squeak 6.0alpha

I wonder whether it's possible to display the assignment operator '_'
underscore as Left Arrow.

"Cuis-Smalltalk" is doing this, looks very nice.

I've found something on wiki.squeak.org :

        syntaxHighlightingAsYouTypeLeftArrowAssignment

in preferences.

Go to Menu -> Tools -> Preferences
(or Menu -> Apps -> Preferences Browser)

Search : syntaxHighlightingAsYouType

(it's under "browsing')

enabled

syntaxHighlightingAsYouTypeLeftArrowAssignment

enabled

does not work  : do I need "Shout"

http://wiki.squeak.org/squeak/5700

is Shout still working in 4.6 ?

I have the impression from the wiki.squeak.org page that there existed
a package to display '_' as left-arrow but not sure whether it is still there.

David Stes

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQEcBAEBCAAGBQJgAw4BAAoJEAwpOKXMq1Ma/1gIAK0vac+7G0o+nxaUZpwUZWEG
tpeh0Bg+aruVO330FkJajKDkGxpnRdQ+9sjRQQ1jE3ZDY1V+V7zqQz0fciOtE56L
24l0A3gkhElte7B6zIpXwEUKwBPGrv1egA024JIuxw3Xb/FWNKZeUwMdyZGtn0nW
LAlPjcv+r+/91Bkx8KuLT7E2Jas/JL3UpYYug9/F5umE/maN4+E3aKfggef8VKvz
fdm7xDYBCDatQFqwsa1ixdKxAGql0+SID7QY1tRQ2hvBdl1jQmBWT6wXF9sDRELm
YzXf2TWUiXUQDefr0Yc+qsJbYETKf0D4PmsdxNGgwwZ7zFbWpDm/OKy73wyhMiA=
=xekh
-----END PGP SIGNATURE-----
_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: syntaxHighlightingAsYouTypeLeftArrowAssignment

marcel.taeumel
Hi David.

I wonder whether it's possible to display the assignment operator '_'
> underscore as Left Arrow.

Well, the original font rendered the underscore character ("_") as a left arrow. One could still extend Shout to add a special text attribute to either "_" or ":=" to change to a font that has such a property. Maybe take a look at FormSetFont and the example in FormInspector >> #embedForm:inText:.

Of course, you could directly change the system's code font to one that renders all "_" as a left arrow, regardless of the context.

Note that it might be confusing for some users to see a left arrow as a single entity while actually having to type ":" and "=".

Also note that we removed all underscore assignments ("_") from Squeak's Trunk repository. For good. :-)

Best,
Marcel

Am 16.01.2021 17:03:31 schrieb [hidden email] <[hidden email]>:

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256


Hi,

Platform: squeak 4.19.5 with Squeak 4.6 or squeak 5.x with Squeak 6.0alpha

I wonder whether it's possible to display the assignment operator '_'
underscore as Left Arrow.

"Cuis-Smalltalk" is doing this, looks very nice.

I've found something on wiki.squeak.org :

syntaxHighlightingAsYouTypeLeftArrowAssignment

in preferences.

Go to Menu -> Tools -> Preferences
(or Menu -> Apps -> Preferences Browser)

Search : syntaxHighlightingAsYouType

(it's under "browsing')

enabled

syntaxHighlightingAsYouTypeLeftArrowAssignment

enabled

does not work : do I need "Shout"

http://wiki.squeak.org/squeak/5700

is Shout still working in 4.6 ?

I have the impression from the wiki.squeak.org page that there existed
a package to display '_' as left-arrow but not sure whether it is still there.

David Stes

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQEcBAEBCAAGBQJgAw4BAAoJEAwpOKXMq1Ma/1gIAK0vac+7G0o+nxaUZpwUZWEG
tpeh0Bg+aruVO330FkJajKDkGxpnRdQ+9sjRQQ1jE3ZDY1V+V7zqQz0fciOtE56L
24l0A3gkhElte7B6zIpXwEUKwBPGrv1egA024JIuxw3Xb/FWNKZeUwMdyZGtn0nW
LAlPjcv+r+/91Bkx8KuLT7E2Jas/JL3UpYYug9/F5umE/maN4+E3aKfggef8VKvz
fdm7xDYBCDatQFqwsa1ixdKxAGql0+SID7QY1tRQ2hvBdl1jQmBWT6wXF9sDRELm
YzXf2TWUiXUQDefr0Yc+qsJbYETKf0D4PmsdxNGgwwZ7zFbWpDm/OKy73wyhMiA=
=xekh
-----END PGP SIGNATURE-----
_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners

_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: syntaxHighlightingAsYouTypeLeftArrowAssignment

Tobias Pape


On 18. Jan 2021, at 10:19, Marcel Taeumel <[hidden email]> wrote:

Hi David.

> I wonder whether it's possible to display the assignment operator '_'
> underscore as Left Arrow.

Well, the original font rendered the underscore character ("_") as a left arrow. One could still extend Shout to add a special text attribute to either "_" or ":=" to change to a font that has such a property. Maybe take a look at FormSetFont and the example in FormInspector >> #embedForm:inText:.

Of course, you could directly change the system's code font to one that renders all "_" as a left arrow, regardless of the context.

Note that it might be confusing for some users to see a left arrow as a single entity while actually having to type ":" and "=".

Also note that we removed all underscore assignments ("_") from Squeak's Trunk repository. For good. :-)



SyntaxHighlightingAsYouTypeLeftArrowAssignment _should_ work:
"
'If true, and syntaxHighlightingAsYouType is enabled,  all ANSI format assignments ( := ) will be converted to left arrows ( _ ) when a method is selected in a Browser. Whilst editing a method, this setting has no effect - both the left arrow and the ansi format may be used.
"

If I enable it, I see _ instead of := in all methods, so it works fine.


Note that the fonts themselves support swapping _ and ^ for arrows.

Variant A: (destructive) See TextStyle>>#makeArrows
Variant B: (semi-destructive)
See StrikeFont>>#useLeftArrow and StrikeFont>>$#useUnderscore.

However, useLeftArrow is not completely right.

It should read:

useLeftArrow
self characterToGlyphMap.
characterToGlyphMap at: 96 put: 131.
characterToGlyphMap at: 95 put: 130.


After that, If you do

```
Preferences enable: #syntaxHighlightingAsYouTypeLeftArrowAssignment.
Preferences standardCodeFont useLeftArrow.

```

You'll see:

However, shout seems to do strange things there if #syntaxHighlightingAsYouTypeLeftArrowAssignment is on.
It tries hard to show the "assignment" as _ no matter what.

That said, It is supposed to somewhat work :)

Best regards
-Tobias


Best,
Marcel
Am 16.01.2021 17:03:31 schrieb [hidden email] <[hidden email]>:

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256


Hi,

Platform: squeak 4.19.5 with Squeak 4.6 or squeak 5.x with Squeak 6.0alpha

I wonder whether it's possible to display the assignment operator '_'
underscore as Left Arrow.

"Cuis-Smalltalk" is doing this, looks very nice.

I've found something on wiki.squeak.org :

syntaxHighlightingAsYouTypeLeftArrowAssignment

in preferences.

Go to Menu -> Tools -> Preferences
(or Menu -> Apps -> Preferences Browser)

Search : syntaxHighlightingAsYouType

(it's under "browsing')

enabled

syntaxHighlightingAsYouTypeLeftArrowAssignment

enabled

does not work : do I need "Shout"

http://wiki.squeak.org/squeak/5700

is Shout still working in 4.6 ?

I have the impression from the wiki.squeak.org page that there existed
a package to display '_' as left-arrow but not sure whether it is still there.

David Stes

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQEcBAEBCAAGBQJgAw4BAAoJEAwpOKXMq1Ma/1gIAK0vac+7G0o+nxaUZpwUZWEG
tpeh0Bg+aruVO330FkJajKDkGxpnRdQ+9sjRQQ1jE3ZDY1V+V7zqQz0fciOtE56L
24l0A3gkhElte7B6zIpXwEUKwBPGrv1egA024JIuxw3Xb/FWNKZeUwMdyZGtn0nW
LAlPjcv+r+/91Bkx8KuLT7E2Jas/JL3UpYYug9/F5umE/maN4+E3aKfggef8VKvz
fdm7xDYBCDatQFqwsa1ixdKxAGql0+SID7QY1tRQ2hvBdl1jQmBWT6wXF9sDRELm
YzXf2TWUiXUQDefr0Yc+qsJbYETKf0D4PmsdxNGgwwZ7zFbWpDm/OKy73wyhMiA=
=xekh
-----END PGP SIGNATURE-----
_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners



_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: syntaxHighlightingAsYouTypeLeftArrowAssignment

stes
In reply to this post by stes
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256


Thanks for the feedback.

Sorry for asking, yes, it works, sorry for claiming that it did NOT work.

I think I just forgot to "Save" my preferences, I selected "enable"
for those options and tried it in a Workspace and I think it didn't have
any effect.

Because the feedback confirmed that the option *is* working, I tried again ...

And for some reason (maybe "Save" ?) it works now ...

I had noticed in Cuis-Smalltalk that they have this nice feature,
and I wondered whether it also exists in Squeak.

So it does ...  the feature 1) displays all assignments in Squeak code
as left-arrows for me and 2) when I type in a Workspace it immediately
displays an assignment as a left arrow.

I use a TrueType font that I have found on the net,
which displays the underscore as a left-arrow.

I configured that font as my "code font" in the appearances menu.

As Tobias Pape points out special TrueType fonts are *not* required as Squeak
has the machinery to swap the glyphs.

However there are a few fonts on the net that have old encodings for the
glyphs for up-arrow and left-arrow.

However the solution that Tobias Pape mentions is better, as no special font,
is then required.

Perhaps a small advantage of using a special font is that the special font,
can also work in editors outside Squeak.

Regards,
David Stes

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQEcBAEBCAAGBQJgBXWhAAoJEAwpOKXMq1MasKkIAJX1zzIEH8U22rvsBq2zBjNo
iEWCGsQV0rajWKeB3doMsC+eb+/SMu1B6Taucs/0vnZfHTK6Zlcm0eXBBqLzgp33
ibN0yJmrxsCUM7MPB9vQfKIvYi5gLg+wB0uqQF0aMH6xNW6n4IDKiKL+jn3hJQAo
HrMfCIKn8J+/dSst5xQOs36Skg8Gc+1gZb0TaU/DUdNftPaAJGAMfC2CIJ6SAOQX
Z/M705jhcTl1zZNP1uvg9s5SV2ZAuT+/gI0asbgsMikSpktIj66H0lNcTFPBvsns
vpLEp/sRegUgeJIuxiVn2q3dwjcQNcvC0gkHjxWgr5rwa7xQArNo9MaDhgtCIYo=
=ezi0
-----END PGP SIGNATURE-----
_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: syntaxHighlightingAsYouTypeLeftArrowAssignment

Tobias Pape
Hi


> On 18. Jan 2021, at 12:50, [hidden email] <[hidden email]> wrote:
>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
>
>
> Thanks for the feedback.
>
> Sorry for asking, yes, it works, sorry for claiming that it did NOT work.
>
> I think I just forgot to "Save" my preferences, I selected "enable"
> for those options and tried it in a Workspace and I think it didn't have
> any effect.
>
> Because the feedback confirmed that the option *is* working, I tried again ...
>
> And for some reason (maybe "Save" ?) it works now ...
>
> I had noticed in Cuis-Smalltalk that they have this nice feature,
> and I wondered whether it also exists in Squeak.
>
> So it does ...  the feature 1) displays all assignments in Squeak code
> as left-arrows for me and 2) when I type in a Workspace it immediately
> displays an assignment as a left arrow.
>
> I use a TrueType font that I have found on the net,
> which displays the underscore as a left-arrow.
>
> I configured that font as my "code font" in the appearances menu.
>
> As Tobias Pape points out special TrueType fonts are *not* required as Squeak
> has the machinery to swap the glyphs.
>
> However there are a few fonts on the net that have old encodings for the
> glyphs for up-arrow and left-arrow.
>
> However the solution that Tobias Pape mentions is better, as no special font,
> is then required.
>
> Perhaps a small advantage of using a special font is that the special font,
> can also work in editors outside Squeak.

Maybe using ← and ↑ could simply be used directly?

-t


_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners