double click highlighting problem with quotation marks

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

double click highlighting problem with quotation marks

DougEdmunds
Double clicking just to the left of a closing brace/bracket/parenthesis etc normally
goes backwards, finds the opening brace/bracket/parenthesis and highlights the material
between them.  It does not work correctly if the character immediately before the
closing mark is a single or double quotation mark.  Instead it always goes forward
from the quotation mark to try to find another quotation mark further in the text.

File ExampleClass.st

'From Pharo1.2 of 14 March 2011 [Latest update: #12341] on 23 March 2011 at 11:16:26 am'!
Object subclass: #ExampleClass
        instanceVariableNames: 'content owner'
        classVariableNames: ''
        poolDictionaries: ''
        category: 'Sandbox'!

!ExampleClass methodsFor: 'as yet unclassified' stamp: 'DougEdmunds 3/23/2011 11:16'!
testMessage


        | a b c d|
        a := #( 1 2 (3 4 'test 1') 'test 2').  "click just before last closing parens"
        b := 'test 3'.
        c := #( 1 2 (3 4 'test 4') 'test 5' ). "click just before last closing parens"
        d := 'test 6'.
! !
Reply | Threaded
Open this post in threaded view
|

Re: double click highlighting problem with quotation marks

Nicolas Cellier
Of course, there is an ambiguity whether you want the closing quote or
the opening parenthesis...
And there is an arbitrary precedence rule.

IMO, a modifier key might help to disambiguate...

It would also be a nice thing to have a keyboard combination producing
the same effect,
For example:
- Escape left_arrow selects downto the left opening,
- Escape right_arrow selects upto the right closing...
Unless of course there's already a shortcut I'm not aware of...

Nicolas

2011/3/23 DougEdmunds <[hidden email]>:

> Double clicking just to the left of a closing brace/bracket/parenthesis etc
> normally
> goes backwards, finds the opening brace/bracket/parenthesis and highlights
> the material
> between them.  It does not work correctly if the character immediately
> before the
> closing mark is a single or double quotation mark.  Instead it always goes
> forward
> from the quotation mark to try to find another quotation mark further in the
> text.
>
> File ExampleClass.st
>
> 'From Pharo1.2 of 14 March 2011 [Latest update: #12341] on 23 March 2011 at
> 11:16:26 am'!
> Object subclass: #ExampleClass
>        instanceVariableNames: 'content owner'
>        classVariableNames: ''
>        poolDictionaries: ''
>        category: 'Sandbox'!
>
> !ExampleClass methodsFor: 'as yet unclassified' stamp: 'DougEdmunds
> 3/23/2011 11:16'!
> testMessage
>
>
>        | a b c d|
>        a := #( 1 2 (3 4 'test 1') 'test 2').  "click just before last closing
> parens"
>        b := 'test 3'.
>        c := #( 1 2 (3 4 'test 4') 'test 5' ). "click just before last closing
> parens"
>        d := 'test 6'.
> ! !
>
> --
> View this message in context: http://forum.world.st/double-click-highlighting-problem-with-quotation-marks-tp3400330p3400330.html
> Sent from the Pharo Smalltalk mailing list archive at Nabble.com.
>
>

Reply | Threaded
Open this post in threaded view
|

Re: double click highlighting problem with quotation marks

DougEdmunds
Is there an ambiguity that can't be resolved?
If it looked backward first before looking forward,  
it might find an unmatched 'opening' quotation mark.

This applies to both single and double quotes.