Hi,
is there a way to control indentation by supplying a regex for the previous line and the current?
What I want to do is indent javascript chained methods calls (every line starting with a dot, except if the last line started with a dot itself):
Thanks Fabian
On 10 Oct 2016, at 15:04, Fabian Zeindl wrote:
What I want to do is indent javascript chained methods calls (every line starting with a dot, except if the last line started with a dot itself):
I don’t see any way to achieve this, sorry.
As for the desired “rule”, I assume it would be enough to have a rule that says “indent this, and only this line” if the regexp is a match, which avoids having to look at the previous line.
I’m a little hesitant to add such rule though, as I’d rather switch to a more general system, but I have yet to come up with a system that I like, and a partial solution might be to tie this to the grammar rather than standalone regular expressions.
On 16 Oct 2016, at 15:12 , Allan Odgaard mailinglist@textmate.org wrote:
I don’t see any way to achieve this, sorry.
As for the desired “rule”, I assume it would be enough to have a rule that says “indent this, and only this line” if the regexp is a match, which avoids having to look at the previous line.
Hm, but that wouldn't work for nested chained calls then, would it?
I thought being able to exclude based on the previous rule would be easy since it's looked at anyway, but I see why you might not like that.
Thanks anyway Fabian