auto-edit bulk comment quotes

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

auto-edit bulk comment quotes

WingIDE - User mailing list
Normally I have auto-edit on.  It's a useful feature.

On place it is not is for bulk commenting in Python which is usually
done with triple double quotes:

"""comment
    spam
    eggs"""

And the auto-editor wants to do multiples of two as is otherwise
correct.  Would it be possible to have Wing recognize that inserting a
double quote inside two double quotes should not be doubled?

Best,

coyot
_________________________________________________
Wing IDE users list
http://wingware.com/lists/wingide
Reply | Threaded
Open this post in threaded view
|

Re: auto-edit bulk comment quotes

WingIDE - User mailing list
On 8/30/16 12:43, Coyot Linden (Glenn Glazer) wrote:

> Normally I have auto-edit on.  It's a useful feature.
>
> On place it is not is for bulk commenting in Python which is usually
> done with triple double quotes:
>
> """comment
>    spam
>    eggs"""
>
> And the auto-editor wants to do multiples of two as is otherwise
> correct.  Would it be possible to have Wing recognize that inserting a
> double quote inside two double quotes should not be doubled?
>
> Best,
>
> coyot
More testing: it turns out to be six double-quotes not four.  This is
partly caused by the type over of the second quote.

Also, it would be helpful if the code that detected unreachable code
ignored bulk quoted sections, e.g., like:

new code line 1
new code line 2
return
""" old code line 1
     old code line 2
     return"""

Which produces brown error lines.

Best,

coyot
_________________________________________________
Wing IDE users list
http://wingware.com/lists/wingide
Reply | Threaded
Open this post in threaded view
|

Re: auto-edit bulk comment quotes

WingIDE - User mailing list
Coyot Linden (Glenn Glazer) via wingide-users wrote:

> On 8/30/16 12:43, Coyot Linden (Glenn Glazer) wrote:
>> Normally I have auto-edit on.  It's a useful feature.
>>
>> On place it is not is for bulk commenting in Python which is usually
>> done with triple double quotes:
>>
>> """comment
>>    spam
>>    eggs"""
>>
>> And the auto-editor wants to do multiples of two as is otherwise
>> correct.  Would it be possible to have Wing recognize that inserting
>> a double quote inside two double quotes should not be doubled?
>>
>> Best,
>>
>> coyot
> More testing: it turns out to be six double-quotes not four.  This is
> partly caused by the type over of the second quote.

Are you using Wing 5.1.12 or an earlier version?  As far as I know we
don't auto-insert quotes within a triple-quoted string.  Outside of a
string, it should first insert "|" where | is the caret, then you press
" again and get ""| and a third press yields """|""".  If you select
code first and press """ then it should surround the code with """,
assuming you have Editor > Auto-Editing > Apply Quotes to Selection enabled.

> Also, it would be helpful if the code that detected unreachable code
> ignored bulk quoted sections, e.g., like:
>
> new code line 1
> new code line 2
> return
> """ old code line 1
>     old code line 2
>     return"""
>
> Which produces brown error lines.

Yes, we should probably ignore those.  You may also want to use the
Source > Toggle Block Comment feature instead, which you can configure
with the Editor > Block Comment Style preference.

Thanks,

--

Stephan Deibel
Wingware | Python IDE

The Intelligent Development Environment for Python Programmers

wingware.com


_________________________________________________
Wing IDE users list
http://wingware.com/lists/wingide
Reply | Threaded
Open this post in threaded view
|

Re: auto-edit bulk comment quotes

WingIDE - User mailing list
On 8/31/16 05:54, Wingware Support wrote:

> Coyot Linden (Glenn Glazer) via wingide-users wrote:
>> On 8/30/16 12:43, Coyot Linden (Glenn Glazer) wrote:
>>> Normally I have auto-edit on.  It's a useful feature.
>>>
>>> On place it is not is for bulk commenting in Python which is usually
>>> done with triple double quotes:
>>>
>>> """comment
>>>    spam
>>>    eggs"""
>>>
>>> And the auto-editor wants to do multiples of two as is otherwise
>>> correct.  Would it be possible to have Wing recognize that inserting
>>> a double quote inside two double quotes should not be doubled?
>>>
>>> Best,
>>>
>>> coyot
>> More testing: it turns out to be six double-quotes not four. This is
>> partly caused by the type over of the second quote.
>
> Are you using Wing 5.1.12 or an earlier version?

I am using 5.1.12-1.

> As far as I know we don't auto-insert quotes within a triple-quoted
> string.  Outside of a string, it should first insert "|" where | is
> the caret, then you press " again and get ""| and a third press yields
> """|""".  If you select code first and press """ then it should
> surround the code with """, assuming you have Editor > Auto-Editing >
> Apply Quotes to Selection enabled.

Yes, that's what I got: six double quotes.  I did not know about the
select trick, that works perfectly, thanks!

>
>> Also, it would be helpful if the code that detected unreachable code
>> ignored bulk quoted sections, e.g., like:
>>
>> new code line 1
>> new code line 2
>> return
>> """ old code line 1
>>     old code line 2
>>     return"""
>>
>> Which produces brown error lines.
>
> Yes, we should probably ignore those.  You may also want to use the
> Source > Toggle Block Comment feature instead, which you can configure
> with the Editor > Block Comment Style preference.

I think I prefer the select-and-quote method.

Thanks, Stephan.

Best,

coyot

_________________________________________________
Wing IDE users list
http://wingware.com/lists/wingide