[squeak-dev] Re: Is there a preference setting to block automatic
jakob.reschke at student.hpi.de
Thu Feb 26 23:09:20 UTC 2015
2015-02-26 18:11 GMT+01:00 Chris Muller <asqueaker at gmail.com>:
>> and how should I type Command+(? like, Command-Shift-9? Ok.
>> Why not '(' at that point.
> Because that is used to /replace/ the currently selected expression
> with a new expression. Selection replace is how all editors work, and
> we agreed we wish to minimize surprises and violations of typing
> behavior invariants.
> I think the problem of 2nd line
> above becomes understandable to the user, and, if it is happening
> "constantly" that they will like to learn and use the better way; of
> selecting the expression and pressing Command+(..
I doubt that Command+( is a widely known or sufficiently advertised
feature. In fact, before you mentioned it in this discussion I
believed only OCompletion would provide this desirable feature
(without Command) and I have used Squeak for 2.5 years. The keyboard
shortcut list does mention it (and some more which I will happily use
from now on) but the list starts out rather unhelpfully sorted if you
want to discover "power-user" features and currently also contains
some errors (or some shortcuts do not function correctly), but that is
a different problem.
Therefore, I would prefer when ( with selected text would surround
that text with brackets instead of replacing it or at least Command+(
etc. be advertised somehow.
Personally, I am also fine with skipping brackets in the |))) --> )|))
case because I am used to it from Eclipse and might want to reach a
place in between those brackets to add further arguments... but I
would, like Bert if I understood him correctly, also prefer this
behavior to stop and an additional parenthesis be inserted if the
cursor has been moved with the arrow keys, by mouse click etc. And for
the statistics, I also dislike "|foo" --> "(|)foo" (like most of us)
and generally reaching for the navigation keys to write new code.
Pharo's behavior as described by Martin seems like a good compromise
I also wonder how many people actually write or edit text with
expressions first in mind, like you do, Chris. I figure it is a good
idea for writing formulas (e. g. using a workspace as a calculator),
but at least it did not come to my mind as such for coding (in
languages where you "write in words" and parentheses are mostly
written for the machine).
More information about the Squeak-dev