Strange behavior of auto-indentaiton

  • Vladimir Danilov

    "Auto-indent" is turned on. My steps are:
    1)New file
    2)press Tab
    3)write "hello"
    4)press Enter
    5)press Shift+Tab
    6)press Enter
    7)write "world".
    And I got this:

    But I hoped to get this:


    Is it bug or feature?

    Last edit: Vladimir Danilov 2014-01-07

    THEVENOT Guy - 2014-01-08

    Hello Vladimir,

    Yes, you're quite right. I can reproduce this behaviour.

    But just notice that if you type, for example, at step 6), instead of the Enter key ONLY, the word wonderful and, then, end with the Enter key, the word World, written, at step 7), begins at the first position of the line, without any tabulation

    And I think that is really a feature !. For example, in many languages the start position of code in a line indicates the bloc where it belongs to. And sometimes, we need to insert blank line(s) in code, without breaking the indentation, like in this part of python script below :

    while a == 'Y' or a == 'y':        #  If ANSWER = 'Y' or 'y'
        if dt < 28:
            dt = 50                    #  If DISTANCE too SMALL, DISTANCE is set to the VALUE 50
        lp = "BEST  WISHES"            #  RIGHT part of the MESSAGE
        rp = "GOOD YEAR 2014"          #  LEFT  part of the MESSAGE
        lg = len(lp + rp)              #  TOTAL length of the TWO parts of the MESSAGE
        sh = int((120 - dt)/2)         #  SHIFT from the LEFT side of the SCREEN
        lb = sp*sh +'\x10'             #  LEFT limit  of the ROUTE
        rb = '\x11\r'                  #  RIGHT limit OF the ROUTE

    Best Regards and... Happy new Year !


    Last edit: THEVENOT Guy 2014-01-08

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks