Home Download Buy Blog Forum Support

Indentation fails after comment block

Indentation fails after comment block

Postby myagoo on Mon Jul 30, 2012 2:22 pm

Sublime text 2 v2.0.1 build 2217

I've noticed that the indentation behavior (reindent function aswell) fails after comment block (at least for PHP syntax).
Right after a comment block which contains brackets, the indentation use the tabs count of the last bracket in the comment block instead of totally ignoring it.

Examples using the reindent function and moving the last bracket of test2 :
Code: Select all
function test() {
}
   /*
   function test2() {
         }
   */
         function test3() {
         }
?>


Code: Select all
function test() {
}
   /*
   function test2() {
   }
   */
   function test3() {
   }
?>


Code: Select all
function test() {
}
/*
function test2() {
}
*/
function test3() {
}
?>


I've also noticed this with after multiple lines string concatenation in js.

This is really annoying and can totally mess up the code after a "reindent all".
myagoo
 
Posts: 3
Joined: Mon Apr 02, 2012 2:09 pm

Re: Indentation fails after comment block

Postby duydangle on Sat Aug 11, 2012 3:42 pm

I can see that there are problems with sublime text reindent function :(
duydangle
 
Posts: 7
Joined: Sun Jul 29, 2012 3:30 pm

Re: Indentation fails after comment block

Postby ExploZe on Tue Aug 28, 2012 10:27 am

A lot of problem of indentation !

Like SQL query in $var + comment you get crazy indent and some times crash... I use TextMate to restore a good indentation ...
ExploZe
 
Posts: 2
Joined: Mon Mar 26, 2012 5:12 pm

Re: Indentation fails after comment block

Postby Chris.Barker on Wed Nov 07, 2012 12:16 am

For what it's worth, it's broken after commens in Python mode too. Try:

Code: Select all
for i in range(5):
   some code


(works great)

but:
Code: Select all
def f():
    for i in range(5): # loop 5 times
    oops_no_indent!

not too smart.

Frankly, reindent is pretty weak all around, at least with python (sigh).
Chris.Barker
 
Posts: 2
Joined: Tue Nov 06, 2012 5:24 pm


Return to Technical Support

Who is online

Users browsing this forum: Exabot [Bot], Google [Bot] and 39 guests