[BUG] Selecting lines ending in ' or "

Dan Ingalls Dan.Ingalls at disney.com
Thu Jan 18 04:18:50 UTC 2001


>On Wed, 17 Jan 2001 18:56:13 -0500, Doug Way <dway at riskmetrics.com> wrote:
>> - Correct the selection mechanism in text views so that clicking at the end of a
>> line ending with ' or " selects the line (as it does in other cases) rather than
>> the text following the line.

Jon Hylands <jon at huv.com> replied...
>The problem is that when you select the character to the immediate left or
>right of a single or double quote, the system overrides the line selection
>mechanism in favor of the quote-matching mechanism.
>
>The same thing happens if you end a line with an open paren or open square
>bracket (and probably some other special characters as well).
>
>All in all I'd rather have the behavior that is in the system now than lose
>the ability to match quotes and brackets...

One needn't throw the baby out with the bath water.
The bracket matching scheme is very simple (I wrote it way back):

It looks FIRST to the left for a matchable character and if it finds one it searches right for the match.
THEN it looks to the right for a matchable character and if it finds one it searches left for the match.

It would not be hard to add a precedence rule:
	If there is a quote on one side and another matchable character
	on the other, then match the non-quote,
or the more specific
	If there is a quote on one side and a CR on the other,
	then match the CR.

It's not clear to me that this deserves to be called a "correction".  I can equally imagine the new scheme doing the "wrong" thing for someone and, when it did, it would three rules instead of two to explain how it had failed.    ;-)

	- Dan






More information about the Squeak-dev mailing list