Sublime Forum

How to get text indentation REALLY working

#1

I had sublime text 2 before and in it the indentation worked as far as I remember.
But with ST3 it’s just NOT! It’s driving me nuts!

For example with .js files when I press ctrl-F12
its working, but indentation gets to 0 after first commet!

here is my key config:
{ “keys”: [“ctrl+f12”], “command”: “reindent”, “args”: {“single_line”: false} },

I also have installed and tried some plugins but they dont work also.
I code js, jquery, php, laravel, vue

Windows 7, 64 bit
version. 3.1.1, build 3176, licenced version

0 Likes

#2

Code snippet?

0 Likes

#3
function showHelp(e, txt) {
    txt = txt.trim();
//this comment will break indentation
clearTimeout(helpTimeout);
var k = e;
var txttt = txt;
helpTimeout = setTimeout(function() {
    showHelp_timed(k, txttt);
}, 10);
}
0 Likes

#4

Have you defined that .js files should be opened with the Javascript syntax? You can find the current syntax being used at the far right of the status bar.

To set the syntax:
View -> Syntax -> Open all with current extension as… -> Javascript (or your chosen syntax)

0 Likes

#5

this is a known bug with reindenting comments

0 Likes

#6

Yes, this syntax selection works nicely, no problems there.

Hope this bug will get fixed soon.

Any plugins that does this better ?
I tried JSCS plugin, but that’s one big he** of a problems, and errors

0 Likes