[squeak-dev] Re: Is there a preference setting to block automatic parentheses?

Martin Bähr mbaehr at email.archlab.tuwien.ac.at
Thu Feb 26 16:48:20 UTC 2015


Excerpts from Chris Muller's message of 2015-02-26 17:11:35 +0100:
> 0 > self foo: (|)                                     "ah, the system
> typed the closing paren for me, NICE!"
> 1 >  self foo: (knorz bar: max)              "ah, there is something missing"
> 2 >  |self foo: (knorz bar: max)             " ... "
> 3 >  c add: |self foo: (knorz bar: max)      " oh, that now needs parens "
> 4 >  c add: (|)self foo: (knorz bar: max)    "ah, the system saved me
> a keystroke at 0, so I understand why it did this, is there a better
> way?"

pharo solves this problem by not inserting a closing ) if there is other text
right after the cursor:

3 >  c add: |self foo: (knorz bar: max)      " oh, that now needs parens "
4 >  c add: (|self foo: (knorz bar: max)

if i wanted to insert a new expression i'd type:

3 >  c add: |self foo: (knorz bar: max)      " oh, that now needs parens "
4 >  c add:| self foo: (knorz bar: max)      " back off to get some space"
3 >  c add: (|) self foo: (knorz bar: max)   " type space and ( ..." 

in the other case it behaves the same.

what i am wondering is, why at line 1, once the user moved away from the
closing ) it does not count as accepted?

that would solve the problem in line 8, because, someone typing without paying
attention to the auto-inserts would not move the cursor without actually typing
the ) directly.

greetings, martin.

-- 
eKita                   -   the online platform for your entire academic life
-- 
chief engineer                                                       eKita.co
pike programmer      pike.lysator.liu.se    caudium.net     societyserver.org
secretary                                                      beijinglug.org
mentor                                                           fossasia.org
foresight developer  foresightlinux.org                            realss.com
unix sysadmin
Martin Bähr          working in china        http://societyserver.org/mbaehr/


More information about the Squeak-dev mailing list