Closed zackkrida closed 10 years ago
I would love to see a solution for this, but I don't think it is possible. We use indentation to give meaning to the code. Without it, I don't think it is possible to infer that meaning by any other means. Even colons are optional in stylus, making it very hard.
Consider this contrived example...
<color>
<red>happy</red>
<green>days</green>
</color>
My stylus styles without indentation...
color red
color red
text-size large
color green
color green
do I mean...
color red
color red
text-size large
color green
color green
... which compiles as...
color red {
color: #f00;
text-size: large;
color: #008000;
color: #008000;
}
or did I mean...
color red
color red
text-size large
color green
color green
... which compiles as...
color red {
color: #f00;
text-size: large;
}
color green {
color: #008000;
}
I think that if this problem could be solved in stylus, it could be solved in a sublime text, but I think it is simply not possible.
As a workaround, there could be a generic sublime plugin which simply indents all but the first line of empty line delimited blocks, but that should not be part of the stylus plugin.
I'm not quite sure how it works, or if it would even be compatible with stylus, but Sublime has a reindent command that works great with css, scss, sass, and less. The unofficial sublime docs describe it as follows:
It currently works in stylus when using brackets, but it'd be ideal to have it function without. I wonder if it's possible?
Example:![indent](https://cloud.githubusercontent.com/assets/6351754/4095570/ae5f7d12-2fb6-11e4-8681-104e923ecfc8.gif)