Sublime Forum

Possible bug with auto-indentation in Python

#1

Hi,

I think I found a bug with the code that auto-indents in Python after, say, an “if” line…

If I type the following:

if something:

Then it’ll indent me for the next line, which is great.

Similarly, if I type:

myMethod(

It’ll also indent me, as I haven’t closed all open brackets, which is similarly great.

However, the bug that I found will also indent me in the following case, which it shouldn’t:

myMethod("(")

I can see that it’s looking for brackets, and has seen two opening brackets and one closing, so it thinks I am still inside one of them - what it hasn’t realised is that one of them is part of a string.

It’s not a huge annoyance - I did want to make sure I’d mentioned it, though.

Cheers

0 Likes

#2

I’ve just seen the post under “General Discussion” about bug tracking - I’ll re-submit this over there.

0 Likes