Author Topic: Syntax tab indent for python broken in SE 12?  (Read 13933 times)

garion911

  • Senior Community Member
  • Posts: 201
  • Hero Points: 13
Re: Syntax tab indent for python broken in SE 12?
« Reply #15 on: May 17, 2007, 07:18:08 PM »
Actaully, even if its not at the end of the file do I get that:

Code: [Select]
def a():
    x = 1

class A:
    def __init__(self):
        self.y =2

    def askdhasd(self):
        self.y=3

And insert the def a() func between the __init__ and other func produces:

Code: [Select]
class A:
    def __init__(self):
        self.y =2

def a():
    x = 1

    def askdhasd(self):
        self.y=3

I could understand that SE can't know exactly what I need at that moment (nested func,etc..), but 90% of the time, I'm placing new funcs into a class.. I would guess that most others are too..

Also... Found another fun one:

Code: [Select]
class X:         
    x = { '1':1, 
          '2':2, 

Now hit enter after the last line, and it'll un-indent. Same thing if you try to copy/paste the '2' line.. At first, I though it was something to do with classes (since it causes the issue above), but this occurs here too:

Code: [Select]
def x():       
    x = {'x':1,
         '2':2,



Kohei

  • Senior Community Member
  • Posts: 192
  • Hero Points: 25
Re: Syntax tab indent for python broken in SE 12?
« Reply #16 on: May 17, 2007, 07:33:25 PM »
Is your SmartPaste turned on?  I can't reproduce your 1st case.

But the 2nd case is reproducible.  Well, looks like you've found a bug.

Kohei

garion911

  • Senior Community Member
  • Posts: 201
  • Hero Points: 13
Re: Syntax tab indent for python broken in SE 12?
« Reply #17 on: May 17, 2007, 07:57:11 PM »
Yes, I have smart paste turned on (see screenshot..)

I've now run into something else, but can't seem to replicate it with only a few lines of code.. Same setup as above with the dictionary, but instead of un-indenting.. It indents further..

So:
Code: [Select]
def x():       
    x = {'x':1,
         '2':2,

Copy/paste the second line will actaully produce:

Code: [Select]
def x():       
    x = {'x':1,
         '2':2,
             '2':2,

Like I said, I can't duplicate this in only a few lines of code..