Home Download Buy Blog Forum Support

Code indentation bug?

Code indentation bug?

Postby niallsmart on Tue Mar 06, 2012 6:17 pm

I typically use block comments in Javascript/C with the leading edge aligned like this:

Code: Select all
| function foo() {
|     /*
|      * return 4.
|      */
|     return 2 + 2;
| }


Sublime Text 2 b2183's reindent seems to get confused by the leading space, it changes the code to:

Code: Select all
| function foo() {
|     /*
|      * return 4.
|      */
|      return 2 + 2;
|  }


Note that the return line and the closing brace have each been indented a single space.

This happens regardless of whether I use tabs or spaces for indentation.

Aside from changing how I format comments, is there any workaround?
niallsmart
 
Posts: 2
Joined: Tue Mar 06, 2012 6:10 pm

Re: Code indentation bug?

Postby niallsmart on Tue Mar 06, 2012 6:46 pm

Reindent also seems to have trouble with variable declaration blocks, for example:

Code: Select all
| function() {
|     var x = 2,
|         y = x * 2;
|
|     return x + y;
| }

is reindented to:

Code: Select all
| function() {
|     var x = 2,
|     y = x * 2;
|
|     return x + y;
| }
niallsmart
 
Posts: 2
Joined: Tue Mar 06, 2012 6:10 pm


Return to General Discussion

Who is online

Users browsing this forum: Exabot [Bot], Majestic-12 [Bot] and 9 guests