Groovy-Emacs-Modes / groovy-emacs-modes

A groovy major mode, grails minor mode, and a groovy inferior mode.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add customize option for continuation-indent

djlindstr opened this issue · comments

It would be good if "continuation indent" could be customized. If I need to add line breaks in the parameter list, groovy-mode doesn't give me much choice on how to control indentation of the rest of the arguments.

This example is not very nice - the indentation depends on the length of the function name:

fun(arg1: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit',
    arg2: 234) {
    doThis()
    andThat()
}

The next one is more readable, but the argument list still lines up with the body, and we now need extra rows for the function name and argument list:

fun(
    arg1: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit',
    arg2: 234
) {
    doThis()
    andThat()
}

I would like to have this option:

fun(arg1: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit',
        arg2: 234) {
    doThis()
    andThat()
}

This would correspond to (c-set-offset 'arglist-cont-nonempty '++) in cc-mode, but I think that we can come up with a simpler customization option. :)