[wingide-users] tab should ignore indentation of preceding commented out lines

Wingware Support support at wingware.com
Wed Mar 24 20:34:31 MDT 2010


Mitchell L Model wrote:
> When I comment-out a line with one or two #'s in the first column of 
> the line (and similarly for other columns), Wing loses track of the 
> indentation level where the next non-commented line should go -- I hit 
> TAB and the line goes to column 1. It should ignore intervening 
> comment lines. I would say that in general the editor should ignore 
> everything starting with a # to the end of the line on which it 
> appears, just like the compiler, except for the few commands that deal 
> explicitly with commenting.

This isn't really so straight forward.  If you are typing something like 
this it gets annoying to ignore the commented line also:

def x():
    # do something
    if whatever:
        print 'x'

    # do something else
    |<- want to indent to here, not one level further

This is a fairly common case so it's generally better to pay attention 
to the comment.

If you set the Editor / Block Comment Style preference to Indented 
Comment and use the provided
comment in/out feature then you'll tend to have fewer problems around 
commented out code.

> There is a similar issue with large chunks of code that are "commented 
> out" by enclosing them in triple quotes, but that's uncommon enough -- 
> and subsequent code is unlikely enough to be related to what comes 
> before the commented out code -- that there's no point in worrying 
> about it.

Some people use block comments in the same way as others do comments, so 
it ends up being
a similar case as far as benefit of ignoring vs. not.

At one point I thought we should ignore ## in column zero but I think 
there may be issues
with that also.  I'm not remembering the details at the moment.

-- 

Stephan Deibel
Wingware | Python IDE
Advancing Software Development

www.wingware.com



More information about the wingide-users mailing list