Home Download Buy Blog Forum Support

Auto indentation acting weird (Perl)

Auto indentation acting weird (Perl)

Postby jaredhocutt on Fri Jul 13, 2012 7:38 pm

When creating an if/else block in Perl, the automatic indentation moves the else block one level too far.

When I type:
Code: Select all
if (1) {
}


Then with the cursor just after the closing bracket, I press <space> and then begin typing "else", the closing bracket moves to the right 1 indentation level instead of staying in place. I then:
Code: Select all
if (1) {
    } else {
    }


Instead of getting:
Code: Select all
if (1) {
} else {
}


This does not happen in the PHP editor. Is this related to a setting or have I found a bug?
jaredhocutt
 
Posts: 1
Joined: Fri Jul 13, 2012 7:32 pm

Re: Auto indentation acting weird (Perl)

Postby nick. on Fri Jul 13, 2012 9:23 pm

This isn't happening for me. When I type:
Code: Select all
if (1) {
and press <enter>, I'm left with:
Code: Select all
if (1){
    |
}

where the pipe represents the cursor.

If I try what you described, hitting space after the close brace, the same thing happens but for the else:
Code: Select all
if (1) {
} else {
    |
}


Perhaps a plugin?
nick.
 
Posts: 266
Joined: Wed Jan 18, 2012 3:45 am

Re: Auto indentation acting weird (Perl)

Postby unphased on Mon Apr 22, 2013 3:33 am

I am suffering from this too. It might be one of my plugins, I'll report back if I find it.
unphased
 
Posts: 28
Joined: Thu May 17, 2012 5:16 am

Re: Auto indentation acting weird (Perl)

Postby unphased on Tue Apr 23, 2013 4:09 pm

Tested on ST3 with no plugins on Windows.

I **always** write out the skeleton of an if-else including the else before I start filling in the parts. This causes indentation on the } else { } part to pop out.

I think this is due to it believing that the close brace is a part of the inside of the if () { expression once we type the "e" in else, if even one character is typed inside the if brackets this does not happen.
unphased
 
Posts: 28
Joined: Thu May 17, 2012 5:16 am


Return to Technical Support

Who is online

Users browsing this forum: Google [Bot] and 10 guests