Auto indent lines: (how) does it work?

Hi all, i'm using pycharm since june 2k11 and i'm really happy with it (after some tweaks tho, since it has got some annyoing features like indexing on window  focus etc)

I have just a "small" problem: we're working on a piece of script very long (around 2k lines of codes) and i need to place a try block surrounding 70% of the code, but i'm experiencing this behaviour:

## original code

def foo():

    #line1

    #line2

    #line3

    ---

    #line1k

i'm adding this:

def foo():

    try:

    #line1

    ...

    #line1k

then using auto indent feature the result is this:

def foo():

    try:

        #line1

    #line2

    ...

    #line1k

I tried highlighting all the rows i need to indent (basically, they just need to move a "tab" forward to be under the try block) but i get the same result. am i doing something wrong? or is this the way it's intended to be?

thanks all in advance!

1 comment
Comment actions Permalink

Since indentation is significant in Python, the auto-indent lines feature has only a very limited possibilty to do anything useful. If you need to indent a block of code by one tab, simply select it and press Tab.

0

Please sign in to leave a comment.