Home Download Buy Blog Forum Support

auto-indent and '#'

auto-indent and '#'

Postby mity on Sat Aug 25, 2012 5:23 pm

Hi,

I'm using build 2217 on Windows. Generally the editor is really cool, but there is one little pain with auto-indent. When writing any C preprocessor stuff (e.g. several #include statements), the auto-indent on next line is indented by one char. Obviously it is triggered with '#' on beginning of line.

I was able to suppress it only with complete disabling of the auto-indent:
Code: Select all
"auto_indent": false


For me, the most natural way is trivial auto-indent, when ENTER simply copies indentation of the previous line (regardless of all brackets, tags etc.) Can this be set somehow?

Any help would be appreciated.

Regards,
Mity
mity
 
Posts: 3
Joined: Sat Aug 25, 2012 5:10 pm

Re: auto-indent and '#'

Postby ReinierK on Sat Aug 25, 2012 5:29 pm

Do you have a small code example for us?
I just tried it and I can't reproduce it on Windows Vista, build 2217 (and I have auto-indent enabled).
ReinierK
 
Posts: 23
Joined: Fri Aug 24, 2012 8:27 pm

Re: auto-indent and '#'

Postby mity on Sat Aug 25, 2012 5:36 pm

Strange, tried with new file and it does not happen. I can reproduce this way:

(1) Create new doc (Ctrl+N).
(2) Paste in this source (Ctrl+V): http://mctrl.git.sourceforge.net/git/gi ... .c;hb=HEAD
(3) Switch syntax highlight to C language.
(4) Place cursor on the end of line 19 or 20 and press enter. Voila.
mity
 
Posts: 3
Joined: Sat Aug 25, 2012 5:10 pm

Re: auto-indent and '#'

Postby ReinierK on Sat Aug 25, 2012 6:27 pm

I found the issue!
It's actually the comments block at the top of the page that causes this. You can test it out by creating a new file, set syntax to C (or C++, same happens there) and do your includes: no problem.
Then add a comment block at the start and after that you'll see that a new line will get indented.

I believe this is a bug in Sublime Text2, so it's best to report it with a full description of how to reproduce it.
ReinierK
 
Posts: 23
Joined: Fri Aug 24, 2012 8:27 pm


Return to Technical Support

Who is online

Users browsing this forum: Google [Bot], Majestic-12 [Bot], Yahoo [Bot] and 33 guests