I'm writing some Groovy code, and in my unit tests I have something like the following:
def testFoo(){
given:
//setup statement 1
//setup statement 2
//...
when:
//Execute code
then:
//check results
}
The problem is that emacs, by default, autoindents so that the code looks like the following:
def testFoo(){
given:
//setup statement 1
//setup statement 2
//...
when:
//Execute code
//Execute code 2
then:
//check results
//check results 2
}
That is to say, emacs is indenting the first statement underneath the label.
How do I prevent emacs from doing this? I've tried running M-x c-set-offset <RET> label
and setting the indentation to both 0 and -
to no avail. Which offset should I be customizing?
EDIT: More generally, how do I see which indent rule is in effect at the point?