I was testing host menu support today and as part of the testing
noticed something odd, but in fact it's been there a long time.
You see if you select nothing in a text field (aka a ParagraphEditor)
it makes the entire line disappear. WHAT?
---
Well it's certainly an intentional feature.
Though it's not a feature of VisualWorks, nor perhaps of any other
Smalltalk for that matter, for many years it has been a trademark
feature of Squeak that any text-editing command that requires a
non-empty selection, if issued when the selection is an insertion
point (i.e. is empty,) will first select the current line before
executing the command.
This convention is followed for all the twenty-some-odd commands that
can be invoked from within the text-editor which require a non-empty
selection.
For many users (including me) this convention is a huge time saver
and wrist-preserver.
For example, on a blank line anywhere that text can be typed, you can type:
Morph <cmd-b>
and without needing to click the mouse or fish into a menu, you will
have a browser open on class Morph.
Similarly, you can type
lineSelec <cmd-q> <cmd-n>
and you'll immediately be presented with all senders of
#lineSelectAndEmptyCheck: -- which, incidentally, will reveal all the
commands to which the convention applies.
Or, similarly, type
cut <cmd-shift-W>
to discover all selectors that contain the keyword "cut".
I suppose that if there are others like you who find this feature
unsettling, we could make it be governed by a Preference.
Or perhaps you're only objecting to having the feature apply to
"cut," but would be happy to see it continue to work for all the
other two dozen commands which can be invoked within the text-editor
and which require a non-null selection?
Cheers,
-- Scott