Closed quanticle closed 5 years ago
For the moment I've worked around this issue by adding the following to my .emacs
:
(add-hook 'groovy-mode-hook (lambda ()
(setq-local indent-line-function 'indent-relative)))
What this does is replace the Groovy indent function with the default indent-relative
which indents each line to the same indentation as the previous line. It's not as smart, but it is at least predictable.
This should now be fixed, feel free to reopen if not :)
Hello everyone,
I've noticed an issue with groovy-mode and I'm not sure if it's a problem with my setup or if it's a problem with groovy-mode. The auto-indent behaves inconsistently, in my opinion, around labels, as seen with the following example:
I would expect the indentation to be as follows:
Why is groovy-mode indenting the first statement after the label, but not subsequent statements? Is there a way to turn this off? This makes writing Spock unit tests pretty annoying, since I have to go back and fix the indentation of the first statement after the label every time.